Before this patch, UniqueID was thought to store stable file IDs. However a recently reported issue shows that the file IDs are not always stable, at least on Windows. The documentation for the underlying Windows API states: (note the emphasis)
To determine whether two open handles represent the same file, combine the identifier and the volume serial number for each file and compare them.
Currently, UniqueID does not keep the file handles open. The fact that file IDs were stable until now is only due to a NTFS implementation detail. In some cases, such as drives mounted on network locations, the underlying Windows drivers might or might not generate stable file IDs.
To fix the issue, we keep the file handles open during the lifetime of their corresponding UniqueID instances. Since handles will live longer now, this requires particular attention when performing some file actions, such as file deletions.