Fix bug with closing profiled tasks too early