mtbl.pyx: Added locking around write calls