use write_error instead of get_error_html

get_error_html is removed in tornado 4.0
Merge pull request #6318 from minrk/tornado-4-error-html

use write_error instead of get_error_html