new transaction/locking concept: new function: sql_transaction_boundary()

remove dead/deprecate code from sql_insert(),  sql_update()
use sql_transaction_boundary for rollback, logging in error()
logger(): implement delayed writes (required so we don't have to LOCK logbook in every script)
define proper transaction boundaries in outer-level code framework
simplify / clean up code
temporarily disable update_database(): currently unused; locking needs rethinking
 debugging support in sql_do(), sql_insert(): scrap broken $debug_level concept, use new $debug_requests