fix error in linkedqueue test case. when queue becomes empty, the array should be deallocated.