Call server close only once

Some browser will try to download favicon.ico as a second request.
After the first request the server will be closed, so the request to the
favicon.ico would generate errors in the terminal.
The patch will set a variable which value will chang after server close
called, so next handler will not be called.
Merge pull request #1 from Ajnasz/fix-server-close

Call server close only once