Fix bug in av_file_close()