Because `repository` could be dealloc'd from any thread, we want the to-nil transition to be atomic.