using generic handle instead of fd

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jollamobile.com>