Exponential backoff for websocket failures

Close #1291