testing: fix resource warning with ManagedHTTPServer
We fork a subprocess to serve requests, but the listening socket is bound in server constructor and inherited by subprocess. With this pattern, we have to explicitly close the socket from parent process to prevent the leak.