minor refactor of pyserial code in QT file (ui_mainwindow.py)