Factor out Windows-specific serial port code
Move utility macros to utils.h