check for locked desktop before toggling apps; avoid 100% CPU bug on unplugging the Arduino by checking for a valid tty file