xmlreader: Try to fix regression when reading from memory This reverts a change from commit 2059df53, see #462.