more improvements in ConnectionSemaphore locking and configuration