WindowsTty: propagate ERROR_INVALID_HANDLE and provide packed structs
Some improvements to WindowsTty. The init function will now catch and
propagate an error.InvalidHandle so that caller can catch/handle it.
In addition, I added packed structs for the input/output
console modes which makes it convenient to manage the bits and is what
zigwin32 generates for its bindings. I also made these newly added types
and wrapper functions public as they can be generally useful for terminal
applications.
authored by