Better debug and exception handling

With this commit:
* `--debug` switch now turns on Python's `__debug__` constant,
* ˙sys.excepthook˙ (default exception handler) is replaced by a
  function that prints a traceback as well as issues a Python
  debugger if `__debug__`, so the programmer can interactively
  inspect the error,
* a couple of pointless try-except blocks are now unindented (with
  potential programmers' errors handled by said excepthook).
diff goes weird here. Basically, the try-except blocks were only unindented (try-except removed), trailing whitespace on each line removed, and a few `gtk.gdk.threads_enter/leave()` calls were replaced by a context guard `gtk.gdk.lock`.