Fixed #16674 -- Pass exceptions to WSGI callback

This patch is a attempt at making the patch attached to
https://code.djangoproject.com/ticket/16674 more github friendly, and adds
tests.

It passes raised exceptions to the WSGI start_response callback, so that
WSGI middlewares can track, log or otherwise handle excpetions (as is
done in other WSGI compliant applications, and as specified in PEP 3333).

Thanks to "jamesh" for the original fix.