Add a runIfNotCached function to FunctionWithResultPath.