Add missing onerror listener for WebSockets

This adds a listener to be called when an error occurs.