Use a daemon thread for calling runnable.stop()