Fixed fork()

- fd count was not set on fork()
- file write had incorrect fildes validation
- removed commented out code from sched.c