Use rack middleware to reject invalid UTF-8 bytes

This will prevent requests with strange characters in them raising
500 errors