Not 100% sure what the problem is, here, but it looks like some of the permission/ ownership handling of file in KSaveFile doesn't work the same in Emscripten as it does natively.  Comment that out for the time being. The non-native Emscripten version of Kate can now save.