[versioning] make sure that getVersions() return the correct path

otherwise versions can be lost while moving a file to the trash bin

(I discovered the problem while debugging another issue)