Fix inconsistent behavior of malloc(0)