Hmm Sometimes I've had programs hang on to files even though I think the programs was closed. Lately I've had trouble with Programmers Notepad. Try looking at your applications manager or reboot.
I can guarantee that XAMPP isn't the one doing that. It doesn't access that file at all.
It sounds like you have some network program that is locking the file. Have you added anything new from just before the problem happened to now, other than XAMPP?
As to finding out what application has hold of it I wish I knew. If someone knows how to track what programs have locks on what files I would love to know it as well. I have had windows screw things up like that as well.
When that has happened to me it has at least been on a file I wanted to delete. What I have had to do in the past is...
1. Reboot and tap F8 while rebooting until the boot screen appears.
2. Select boot with Safe Mode Command Prompt.
3. CD to the directory where the file is located.
4. Delete the file and reboot.
5. Then use a registry cleaner like Norton's WinDoctor to remove any registry entries that might have been associated with the deleted file.
A pain in the ass but about the only way I have found to fix the problem when it occurs. You can do basically the same thing but make a backup copy of the hosts file before you do this. Then copy it back when you are finished.
I've encountered this problem before. I believe it's a bug in Windows. The only way I was able to to delete a file once was to..
1. Open the task manager
2. End Task on Explorer (not Internet Explorer)
3. Using the task manager, open a terminal
4. Delete the file
5. Using the task manager, restart Explorer