libafs: don't free a null pointer in an unlikely error condition