PDF/XPS: signal GDI resource exhaustion to callers (might fix issue 2397)