Need to bzero mkey.
Handle deadlocks in history_add().