Fixed issue with input iterator starting too soon

CalculateDenseNodeStage was set up before executing NodeStage, accepting
an iterator of InputRelationship. Calculating the dense node count might
depend on IdMapper to be prepared. IdMapper was prepared after NodeStage
was done. Problem was that the Input used in this test wrapped the
iterator in a resource iterator that retrieved its first item in the
constructor and so made the first InputRelationship pick invalid node ids.

Effect of this would be that the node degree would be off by one for a
select few nodes.

Fixed by using PrefetchingResourceIterator instead which fetches in
hasNext, which is expected in most places.
Merge pull request #3269 from tinwelint/2.2-pbi-degree-inconsistency

[2.2] Fixed issue with input iterator starting too soon