Sockets secure implementations

Rebased on `master`.
nit: This function sounds like a getter(), but it's mutating state. Better name would be:
boolean maybeGrowBuffersForUnwrap()