tmx: Attach to the primary session if it is detached