beefed up testability; fixed run wsgi app functions to close socket after Arbiter.run() returns, freeing up the port