Fix two bugs with the wsgi.input wrapper that is used to normalize
behavior between wsgiref and production-class web servers:
1. Do not hang when reading with a size < Content-Length but the
stream has already been consumed.
2. If Content-Length is invalid or missing, assume no content and
still wrap the stream, rather than sometimes wrapping and sometimes
not.
Also, improve the tests to more cleanly shut down the wsgiref server
between tests so that the above can be tested in a more modular
fashion.