Re-init terminal when awaking from ^Z

And simplify code that nobody touched in a long long time… Fixes input
issues reported in #458.