close serial connection when window close

fixes https://github.com/beagleterm/beagle-term/issues/28