Update AbstractNodeQueue.java

Avoid spinning on head when a peek/poll observes a null next but the queue is not empty.