readline: implements keypress buffering

There was an underlying assumption in readline.emitKeypressEvents (and
by extension emitKey) that the given stream (usually process.stdin)
would emit 'data' once per keypress, which is not always the case.

This commit buffers the input stream and ensures a 'keypress' event is
triggered for every keypress (including escape codes).

Signed-off-by: Fedor Indutny <fedor@indutny.com>