Apply patch from 0.9.13
Destroy socket if ws does not give us a client object