Avoid deprecation warnings for cgi.escape on Python 3