improve handling of native vim write errors