[patch] detach from controlling tty in non-debug mode