websocket.send fails with long data

on slow internet connections the send command fails sometimes to send all the data in one packet. then the websocket connection is out of sync and get's interrupted.

bug appeared while gevent monkey patch was enabled. no other situations were tested.
this commit fixed the bug