aio: Fix eventloop and eof for ssl connections
We can't use feof() and 'buffering none' on ssl connections.
Instead we have to get eof from the ssl layer, and provide
special handling for buffering in the eventloop.
For eof, add ssl_eof() and detect SSL_read() results that indicate
eof to set AIO_EOF in flags.
For buffering, add 'read -pending' that will read, and then immediately
read any buffered data so that the 'readable' event will trigger next
time.
Signed-off-by: Steve Bennett <steveb@workware.net.au>