Fix bug in sys_write()

sys_write now correctly calls dvwrite() instead of dvread()
Return 0 on console open/close