Add tests for html_escape and escape_once
Do not use silence_warnings in html_escape

silence_warnings involves reassigning $stderr, which is dangerous in
threaded environments. As a step towards removing it, remove its use
in html_escape and escape_once.
Encode regexes to match text rather than force text to BINARY.