Replace deprecated cgi.escape with a copy of 3.4's html.escape.