Adapt isValid to only return true when socket is in connected state

Changed isValid() to only return true when the socket is also in connected
state. Also updated the documentation.

Change-Id: Id80dbc1f28c82bef19984c5ed7b34a7d474ee011
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>