Encodes and writes this metadata of the Kotlin module file.
This method encodes all available data, including version.
if kmModule is not correct and cannot be written or if version is not supported for writing.