unregister routes when shutting down

[finishes #50333517]