Refactoring file read/write functions and syscall

- Fixed some trivial warnings and some bugs in syscalls
- getdents() should set seek_pos after reading the directory
- close() should fail if file descriptor is invalid
- One common function for curproc reading & writing
- Added syscall handler for read
- Removed offset from read/write args
- Commented out pwrite() for now