Fix metadata file handle leak in get_object