Unable to delete a package with %25IS_DIR%25packagespackageconfigtestproperties

I am trying to automate the package creation, deletion and re-creation using ant. I was able to successfully create a package with test.properites file located in %IS_DIR%/packages/package/config/ directory. Initial testing is successful. Now, I want to clean (delete) the package structure and re create the package structure. When I try to do that, ant was not able to delete the test.properties file (looks like the IS is holding reference to test.properties).
When I tried deleting the package using IS Admin console, the package gets deleted successfully and after this, If I use my ant task to clean the directory structure, it is still failing with the same problem. If I shut down my IS server instance then this problem goes away. I know I am missing something hereā€¦can someone please shed some light??