[server.py] - close the gui properly/correctly end thread