fix threading issues in xmonad example

Signed-off-by: Mattias Andrée <maandree@operamail.com>