facebook/tornado — pull request #994 by SuminAndrew (2014-02-27 12:55:01+00:00)
Title: make send_error aware of _auto_finish

It is impossible to defer self.finish in `write_error` while in `auto_flush=False` mode

Consider the following example:
```python
def write_error(self, status_code, **kwargs):
def _finish_callback():
self.finish('Error')
IOLoop.add_callback(_finish_callback)
```
This would not work, because `send_error` in the end calls `self.finish()` (https://github.com/facebook/tornado/blob/master/tornado/web.py#L876), even if `auto_flush` is False

I propose to call `_execute_finish` instead, it seems that it shouldn't break compatibility in any way.