Stop the event loop when stopping the backend