Only attempt to kill process if we've passed the timeout. And add a thread sleep to wait for files to unlock.