fix regression: quit program then cancel aborting current game still quits

since b7323dfcd5e39c065d55de10eb1437266b358100
stop processing game related messages when the game has been aborted

this happened only sometimes, and it is proably an easier fix than
trying to avoid such situations
Query: new class DBHandle

better encapsulates database related stuff like
- logging around transactions
- converting error messages to unicode
- initialize data base as we want it
- call to close() is guaranteed
--game: allow specification of hand/discard with --nogui
--nogui implies --demo
hashIsKnown must also check predefined rulesets
Debug.process shows pid in log messages and general memory usage
adapt kajonggtest to changed command line arguments
kajonggtest: do not pass redundant --ai=Default
fix more races triggered by kajonggtest
- while creating directories
- when creating the database
- when writing rulesets or scores
Ruleset editor: all changes are now applied at once

and Cancel in the config dialog does not take the changes back.

This is done because the only clean way would be a transaction which
is then committed or rolled back - like it was until now. But sqlite3
locks the whole database for transactions. So if this is done while a
game is running, it cannot save its score.

Cleaner would be to remove the ruleset editor from the config dialog
and give it its own menu entry
Remove ruleset editor from config dialog

because changes in this editor are applied immediately, no cancel option.
Instead give it its own menu entry.
Debug.events

activates an applicationwide event filter
InternalParameters: rename hasGUI to gui, corresponding to --gui
do not kill perspective prematurely

this makes commit 94db4c4 superfluous
aborting game or program: a better fix

for b7323dfcd5e39c065d55de10eb1437266b358100
make sure that isAlive() can be imported from everywhere
rewrite all dialogs in kde (QuestionYesNo, Information, Warning, Sorry)

using createKMessageBox. This makes it easier to use them with twisted,
and they can now sbortly appear and disappear in demo mode.
Query: make hasTable backend agnostic and use it everywhere
query.py: move more things from Query to DBHandle