misc ungetc fixes

Conflicts:
	src/library.js
Convert to new stream API function names

Conflicts:
	src/library.js
Convert all libc functions to using FS.getStream

Conflicts:
	src/library.js