catch errors in wsgi.Middleware.

- Catch errors in wsgi.Middleware like done in wsgi.Applications.
- Add tests for test_middleware.
- Fixes bug 1128379.

Change-Id: I2e95595c392631aebf2682d4506e4dde78cd6d69
Merge "catch errors in wsgi.Middleware."