double-checked locking for find_or_create