Check _output_array flag in api.web.RequestHandler.write_error

In some cases `RequestHandler._output` would be set to the wrong type.

I hit this bug when trying to call the `station_song_count` endpoint.