Check _output_array flag in api.web.RequestHandler.write_error

In some cases RequestHandler._output would be set to the wrong type.
Merge pull request #11 from williamjacksn/r4

Check _output_array flag in api.web.RequestHandler.write_error