Provide proper serial coms threads shutdown when compiling for Windows