Fix selser on-demand DOM parsing crash

This code path is sadly not covered by parserTests since the DOM tends to be
available there (it is cached). The latest selective serializer does not seem
to work too well with the VE yet (hangs), which needs further investigation.

Change-Id: I635809cf56a526dfe73f282d286ab77833e0a255