fixes bug 1072286 - 500 errors on 404s from the crash_data middleware

@rhelmer r?

Some day we ought to clean up all our mocked test fixtures to stop using the pdump and return json dumps instead. But for now I'm just following suite. 
Also feels a little weird to me to have a nested function here but seems ok. You're using it more than once so anonymous function isn't really appropriate, you could do ```handle_404 = lambda ...``` but I don't think it's any clearer.