add client close frame

An old realization of ws client was cause of exception in server part in time of disconnecting.
Add right code for correct disconnecting.