When the creation of the Avro schema would fail for a file that is being opened, the errors wouldn't be handled properly. Also free all allocated memory on failure. All errors that set errno are now properly logged with the error number and message.