Fix printing crashes on Windows.

See https://bugzilla.novell.com/show_bug.cgi?id=380675