Fixed errors when shutting down server in case of failed init

Added checks in stop of metrics service and event service in case of failed initialization.