How to check if a file is locked by another process and keep checking for specified amount of time? - C#