Fix crash attempting to load the same wallet with different path strings that resolve to the same absolute path.
More details here:
https://github.com/bitcoin/bitcoin/pull/14552
Backport of core PR14552:
https://github.com/bitcoin/bitcoin/pull/14552/files
Depends on D4885.