Add overrideable method RequestHandler.log_exception.

Most apps that currently override _handle_request_exception can now
use a combination of log_exception and write_error.

Closes #730.