Replace deprecated malloc.h with proper stdlib.h