When a query is being executed, but gets terminated from server side (kill, timeout etc.) SQLyog doesn't reflect that changed state.
From SQLyog side, the query can then not be stopped with “Stop Execution” (it says the Thread ID does not exist), nor can the tab or the program be closed (is says that queries are still running).
The only way to stop SQLyog is using the task manager and kill it from the system.
SUGGESTION:
When “Stop Execution” is pressed and it's detected that the Thread ID is not existent on the server, treat the query as if it had been stopped from client side, and make the program usable again.