delay open serialport to trap errors

On Mac OSX, when the serial port is not available the error is not trapped and the process exits. These changes delay opening the SP until the error handler is in place.