test: make sure all handles in the loop are closed