Fix ungetc on nodefs

I made the proposed change in #2266 since it appears to be inactive.

When poking around with making a test, I found that there's already a test for ungetc on memfs which filfills the need for a regression test. So I hooked the test up to nodefs, only to discover that it miserably fails because nodefs doesn't clear ungotten on llseek.

I've therefore moved the resetting of self.ungotten one level up, out of the fs-specific implementations and into the generic library_fs wrappers. This means new filesystems automatically get it right and the test passes.
Actually I think this is fine - js_engines is meant to be a list of js engines, so listify only applies when it comes to actually taking an element out and doing something with it.
(I copied this line from further down in the file)