Clean up load.c

These patches are for error mode.

SIZE_ERROR macro is related on #752. The current code is possible to cause overflow on malloc in case SIZE_MAX < UINT32_MAX.

Some NULL checks are effective for all architectures.