Handle TypeError on parsing JSON.

In Tornado, request.body is normally a string, but it can be a
concurrent.Future on streaming requests. This means we also have to
handle TypeErrors on parsing JSON.