x86: fix up `make term` for x86

When qemu-i386 shuts down the instance on its own accord, like in the
hello-world example, then the terminal is broken afterwards.

This PR ensures that the terminal flags are restored on shutdown.