Only set up XPC connection once.

TODO move run loop to background thread and add method to join thread (and
block the main thread) only when wanted.