Backend: Make graceful shutdown actually work