heartthreader: fixed dangling open files