Add QT_DEBUG flag to darwin

Also small fix to X11 and Linux.