[tpwd] Fix checking for interactive shell