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.
i see what you mean, let's leave it as is.