handle WaitReadable and WaitWritable errors
Add tests for last commit

The background for this is in #13 and here: http://ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL/Buffering.html#method-i-read_nonblock
Merge branch 'pr_13'