fix the syscall issue with _exit(0) and write() calls
fix syscall issues with write and exit(0)