Update MockHTTPServer code to close threads.