tls: stop NodeBIO::Gets from reading off end of buffer

NodeBIO::Gets was reading off the end of a buffer if it
didn't find a "\n" before the EOF.  This behavior
was causing X509 certificates passed to `https.Agent`
via the "ca" option to be silently discarded.

Bug introduced in:
  a58f93ffc4a23aa7240808288acf8cf9f3022abea

Gist containing test code and notes:
   https://gist.github.com/maxtaco/9211605
Merge branch 'master' of github.com:maxtaco/node