tty: Fix unbalanced BKL handling in error path