fdo#66232 fix opening files via COM server

Thanks to Noel Grandin & Stephan Bergmann for the hint on IRC.

Change-Id: I2b407a53b02a7ecdbff553ad47674c1e00455180