Add write file support for domfs.
Fix file mode in open context.
Fix bug in base binding.