WebsocketRpc: Cleanup callbacks before exceptions occur