File_entity related fixes + locking on metadata fields