Fixing IO thread memory leak

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