misc ungetc fixes
Convert to new stream API function names
Convert all libc functions to using FS.getStream