Revert "Disable sqlite same thread check. (Re:Issue #654)"

This reverts commit 03780eab62d3aabce9036e947bfa5faa77ece451.

* Disabled thread checks may cause sqlite3 to fail in unexpected,
  difficult-to-trace ways. The threading issue shall be resolved more
  systematically in the future.
Merge pull request #940 from Renelvon/enable_thread_checks

Re-enable DB threading checks