Fix reordering of file object async write/read callbacks
Fix size of file open parameters
Fix and extend debug output
Remove redundant file permission values
Add task object type
Make all API object types reference counted