mtbl.pxi, mtbl.pyx: Release the gil where possible

Should improve threaded Python performance
mtbl.pyx: Added locking around write calls