Rewrite pushing unused characters to fix a warning from Clang's static analyzer.

Also, correctly adjust the number of characters read to reflect the fact that we have "unread" these characters.