Database::query - add profiling info to queries like BEGIN or COMMIT

Merging #884 into the upcoming release