Close the static file server gracefully

Instead of just killing the process we can save a references to the server and call its close method.