Write usage metrics to disk before terminating
BridgeDB writes its usage metrics to disk every 24 hours. It does not, however, write the metrics to disk when it's restarted, which means we are losing up to 24 hours worth of usage metrics after each restart. We should make BridgeDB write its incomplete metrics to disk before it terminates.
Let's also make sure that this fix plays well with our logrotate cronjob on polyanthum.