Re-add a useful assertion in websockets. Fixes #522
Merge pull request #1356 from zcorpan/fix-522

Re-add a useful assertion in websockets. Fixes #522; r=Ms2ger