Run creates and runs a simple server that will call handler for each
connection and write back whatever that function returns to the client.
Content is served over a Named Pipe on Windows or a Unix domain socket on
Linux and Mac.
Returns a function that can be called to stop the server.