You lost me with the www-data. On my windows 10 development system, the windows permissions give full control to my administrative user same as any other windows folder. However, if I look at the folders through the Git Bash window, I see the 755 for window permissions on all directories including tmp and public.
I modified the Inc/Claz/Config.php file to catch the error when the new file is opened rather than when the attempt is made to write to it. This doesn’t fix your error, but kills the request and reports the error where it occurs.
Try this to verify error occurs at attempt to open the new file for write access. If not there, then the resource handle is being corrupted after being opened and that information would be helpful.