Make related models collection thread-safe.