minor fixes to return codes of closedir, telldir
Convert to new stream API function names
Convert all libc functions to using FS.getStream