Update AbstractNodeQueue.java to avoid redundant reads of head in peekNode

Avoid spinning on head when a peek/poll observes a null next but the queue is not empty.
In any case, since peekNode is used for isEmpty, which could be called from the outside (most notably so in hasMessages), this optimization could be wrong, so if we change peekNode we need to check all use-sites of peekNode and make sure only the consumer uses it, and in the same PR we also need to switch from peekNode for isEmpty.