Fixing FD leak in IO thread

Change-Id: I867eac6163675b2b47477014af14648bf56dbe7d
Signed-off-by: TanelDettenborn <tanel.dettenborn@gmail.com>