handle EOF for secure_socket::read()