When iterating a list of queued_items make sure to do it by reference

Change-Id: I93a4cce079397b40b6c36865bbc8c1cef028d4c6
Reviewed-on: http://review.couchbase.org/43489
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>