Updated stty behaviour to clean up output in non interactive shells

Using stty commands in an non interactive terminal will cause errors to be thrown like this

'stty: standard input: Invalid argument'

When using Rye as part of automated scripts that are run by a non interactive shell (like jenkins for example), and on a lot of hosts - this gets very messy and fills the output with noise.

I have changed the session state save to only occur when the tty is interactive.