Escape characters in XMLLayout and HTMLLayout

Fix LOGBACK-728 and LOGBACK-440.

Add unit test for XMLLayout: validate against log4j.dtd found in log4j
(added as a test dependency).

As log4j-over-slf4j is a test dependency as well we must take care to
have log4j-over-slf4j first in the classpath so that it can take
precedence over log4j.