IIRC, Windows will not let you open a file that's already open "rw" by another process so all you have to do is to read the directory, and try to open any file there (doing it in some way that does not wait for the file to be released), if the open call fails, just continue with the following one. Sleep. Repeat.
A completely different aproach is to put the required functionality into the SFTP server. You can extend Net::SFTP::Server adding your custom logic in the file close operation.