Fix setterm error when using non-interactive shell logins