Fixed memory leaks in chunk queue operations