fix using result of void function in opToolkit::writeCacheFile() (fixes #3302)