STREAMS-86 | Added write lock when we reassign the queue's reference in the prepare method