You may arrange your steps some like below:
master
container step (allocate resource here)
steps actually doing things
steps waiting for other builds to finish
This way resource will be released after the container step.
If you really want to change build status, call below groovy code:
groovy:
import com.pmease.quickbuild.model.Build;
def someBuild = system.buildManager.load(someBuildId);
someBuild.setStatus(Build.Status.FAILED);
someBuild.setErrorMessage("some error message");
system.buildManager.save(someBuild);
Currently side effect is that the build statistics will not be accurate.