resourceloader: Simplify validateScriptFile() with getWithSetCallback