technically, pressing stop should close he webserver connection and therefore stop the webserver process, which stops PHP, which closes the connection. I guess databases don't like to abort queries.
What exactly is the problem?
Just checking: how did you optimize your database?