fix the memory leak in lock-free queue