[PATCH v3 2/3] xmllite/writer: Handle possible memory allocation failures