lib: remove and restructure calls to isNaN()

Switch condition order to check for null before calling isNaN().
Also remove two unnecessary calls to isNaN() that are already
covered by calls to isFinite(). This commit targets v0.10, as
opposed to #7891, which targets master (suggested by
@bnoordhuis). Closes #7840.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
child_process: handle writeUtf8String error

When handling `writeUtf8String` error, return after emitting it.
Otherwise a runtime failure can occur.

fix #7923
stream2: flush extant data on read of ended stream

A ReadableStream with a base64 StringDecoder backed by only
one or two bytes would fail to output its partial data before
ending. This fix adds a check to see if the `read` was triggered
by an internal `flow`, and if so, empties any remaining data.

fixes #7914.
explicitly use state.flowing vs. nOrig === undefined
remove extraneous howMuchToRead
add check for state.decoder
there's no way to get endEmitted to be true in this statement
simplify flow, per @indutny
further simplify
Add comment detailing sequence of events
remove trailing whitespace