convert TreeLeaf::insertTo_DB() to use bound variables

This fixes the problem with backslash quote escaping being unrecognized by sqlite parser, thus resulting
in malformed queries. However, full SQlite compatibility would require inspecting the whole code and
updating where necessary. This is a larger task which should be done someday later in the future. For now,
we will just keep it simple.