Fix "Edit Externally" issues on Win32
Rebased version of MR !4372 (closed) submitted by @kai.schroeder with a bonus feature.
Bonus feature:
The action "Edit Externally" is also available for clones of linked images. It edits the original image whose clone the context menu was popped up on.
Fixes #3193 (closed)
Edited by Rafał Siejakowski