Stop assuming that [mc]alloc can't fail

Always check the return value and propagate it up the chain.
The error is returned to SAP as major_status=GSS_S_FAILURE,
minor_status=ENOMEM.

Be careful to not use the errno magic symbol if there are intervening
calls (such as to free()); rewrite errors as ENOMEM in such cases so
as to avoid needing another variable to hold the saved errno.

This is an annoyingly large amount of churn, but seems like the
right thing to do for an enterprise-grade product like SAP.