gw1500se - 2012-02-26

I believe I have found a bug in replaceregexp when it is used in a build file and run in background. I've searched for this particular error but nothing seems to address what is happening to me. I have a build file that works perfectly from the command line. However, if I run the build in background (i.e. no console) I get the error:

BUILD FAILED
/var/www/html/Applets/KCBSEvents/makejar.xml:39: Couldn't rename temporary file /tmp/replace8780274197734535594.txt
at org.apache.tools.ant.taskdefs.optional.ReplaceRegExp.doReplace(ReplaceRegExp.java:480)
at org.apache.tools.ant.taskdefs.optional.ReplaceRegExp.execute(ReplaceRegExp.java:520)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: Failed to delete /var/www/html/Applets/KCBSEvents/src/KCBSEvents/resource/build.properties while trying to rename /tmp/replace8780274197734535594.txt
at org.apache.tools.ant.util.FileUtils.rename(FileUtils.java:1307)
at org.apache.tools.ant.taskdefs.optional.ReplaceRegExp.doReplace(ReplaceRegExp.java:474)

I found a similar problem on bugzilla but it has been around a long time with no activity other than a recent update by me. However, at the time I thought it was an ANT problem but looking at the trace it seems specific to replaceregexp. Am I the only one that has encountered this and if not, is there a workaround? TIA.