Fix flag checking bug in sys_read()
Implement incrementrefs() for file API
Implement close syscall