Catch OSError exception when accessing serial ports on OSX