Put Windows helper functions into util namespace
Windows: Correctly restore console state on exit