Enhance thread-awareness

These commits add the setup code required to use a `TCBDB` handle in a multi-threaded environment, and release the OCaml runtime lock around `tcbdbdefrag`.