A fail-fast wrapper around C library memory allocation functions.