Lua plugin: fix bad behaviour for io.open(path, 'w')