Add API for handling the time out errors when waiting for read or write

Task-number: QTBUG-32680
Change-Id: I1e69bea596b45867119c681bd22abba6dbb1861c
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>