Only send 500 responses on exceptions when safe

In particular:

If the user has already sent (at least) the beginning of a request, and
the response has not yet started.
Disable some exception tests