Locking for SF_LAZY_CONNECT.