malloc-fail: Fix null deref if growing input buffer fails Also add some error checks. Found with libFuzzer, see #344.