properly shutdown listener and debug server
properly shutdown metrics ticker