Fixes memory leak in per-thread context Signed-off-by: Alexander Pinčuk <alexander.v.pinchuk@gmail.com>