Fixed bug in reporting fd state for files

There are now basic test cases on fd.open and fd.pipe

fixes #18