Fix daemon stopping thread and closing display connection