(19514) Fix failing tests for expectations of not setting trusted

Some tests did not expect a call to Node.set_trusted_data. This commit
now only sets this if Puppet[hashed_node_data] is true.