Fix ws socket byte reading.
Indeed read_stream may not read all the expected bytes at once, so ensure in a loop it gets all the expected bytes if possible.