Set first to NULL as well when the length becomes zero
Parallel working, had to add enqueue in critical region otherwise first becomes NULL sometimes