Checked for proper COM port opening in isSerialMonitor, to prevent crashes due to attempting to read an invalid file handle.