[Fixed JENKINS-18024] Avoid NPE

Reoson why item is in the queue can be null and in such cases we will hit NPE. As whyInQueue is local variable initialized as empty string and is assigned only when the reason is not null, this should prevent NPE.