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

An example:

```
Query plpoznan (99) (master): COMMIT /* SiteStatsUpdate::doUpdate Macbre */
```

This change should make it easier to debug issues like the following one:

```
May 31 10:08:02 cron-s3 apache2[7988]: SQL (yugioh): 2006: MySQL server has gone away (10.8.52.49)
May 31 10:08:02 cron-s3 apache2[7988]: SQL: invalid query: COMMIT
```

@federico-lox @owend @psychonaut @Wyvek