Write tests for opening and sending data over the USB serial line on Windows.
Fix various issues associated with the above change.