crypto: change assertion to condition in bio

Read head can be the same as write head, even if there's some data to
read.
buffer: write strings directly from call

Buffer(<String>) used to pass the string to js where it would then be
passed back to cpp for processing. Now only the buffer object
instantiation is done in js and the string is processed in cpp.

Also added a Buffer api that also accepts the encoding.