Add locking around the flush call as well. This should prevent intermixed metrics going down the wire.