Fixes #4792 (Duplicate definition since 2.6.1 upgrade)
The evaluate_definitions method was first figuring out which resources
needed to be evaluated (using unevaluated_resources), and then
evaluating them one by one. As a result, if evaluating one resource
triggered another resource to be evaluated, the latter resource could
get evaluated twice. This bug could occur, for example, if both
resources were classes that were included into the node by an external
node classifier, and if the first of the two classes included the
second.
Modified Resource#evaluate to be idempotent.
Also added an integration test to verify the fix.