checking connection inside loop

You are not using capabilities of `sync.RWMutex` so just `sync.Mutex` is enough (unless you plan to?)