Support stream wrappers in XML parser extensions

Closes: #2829
Use timeout from GNU coreutils instead of bash hack

When using timeout.sh to run tests, test execution hangs until the
"sleep 1" finishes, probably because the monitor process keeps
filehandles open. If you instead use timeout from GNU coreutils, test
execution is about 2.5 times faster -- I measured a drop from 75 to 30
seconds for test/quick.
Re-add LIBXML_NOEMPTYTAG, accidentally removed