>Note that the permissions on the data file itself do not matter for "unlink" -- only the permissions on the directory containing the data file are important.
No, that's UNIX. On Windoze, to quote the MSDN:"To delete or rename a file, you must have either delete permission on the file or delete child permission in the parent directory". An attempt to delete an open file will fail, and that is probably what is happening here.