Tweak serial naming and free() serial_port structure.
Rewrite timer communication to use a state machine and structs.
free() timer struct during cleanup.
Split thread shutdown notification / join.
Keep the main window open while waiting for shutdown.