Use connection reference counting
Get rid of pthread_join()
Threads are hard
Add lock reference counts