libpayload: Fix malloc allocation
Apparently the previous version worked on luck. Fix the allocation
and add parens to better guide the compiler. Also, halt() if
the heap is poisoned (like by an overrun). Finally, fix calloc()
so that it actually works.
Signed-off-by: Jordan Crouse <firstname.lastname@example.org>
Acked-by: Peter Stuge <email@example.com>