Check for data to read in the openssl buffer before calling select on the network connection.

Occasionally there is data left in the openssl buffers when the data read by the application doesn't match with the openssl encryption block sizes. In this case, calling select on the read file descriptor caused a hang because the data the application was waiting for was already in the buffer (this problem was observed when using SSL from the Prods API). The SSL_pending() call checks to see if data is in the openssl buffer, so we will only select() on the read if there is no data available.

Signed-off-by: Chris Smith <chris@distributedbio.com>

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5421 ea137bd6-aa86-47b6-b90d-b101d9f19a90