common: New function gnupg_remove_ext.
* common/sysutils.c (gnupg_rename_file): Factor out the wait function to ... (w32_wait_when_sharing_violation): New. (w32_remove): New. (gnupg_remove_ext): New. (gnupg_remove): Now a wrapper arounf gnupg_remove_ext. (gnupg_rename_file) [W32]: Use 32_remove with indefinite wait for sharing violation.
Forward port of 2.2 commits:
7e3050547314f8c1625f2a1d9e116ff0b534a2bf
8491117f091ae9db1c1df2e6b9199ccde82a7d0a
This is based on a suggestion by Gniibe in
- GnuPG-bug-id: T7829