Fix #203 unregister metrics at shutdown.