Add ws_socket deinit functionality

Targets #553

Something missing here? I'm not sure...