sqlite: Connection: Use heterogeneous lookups for hooks

This saves a temporary std::string construction/destruction each time
the hook is invoked, which is at least once per modification request,
and more when triggers are involved
8 jobs for !471 with optimize_update_hook in 6 minutes and 28 seconds (queued for 10 seconds)
latest merge request