Fix over-eager artifact rescuing.

If a child artifact has gone away, then we must not rescue the parent
artifact.

Change-Id: I2e8509f458193c0238e53c450faee2e1a0e27b14
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Fix rule comparison.

We used to just compare the source code of the prepare script, but that
was too much of an optimization. Simply use the ScriptFunction's
operator== (which was also missing a member comparison), everything
else is a maintenance nightmare.

Change-Id: I625263e8dea42cbf42624c00434032d7b7146dc9
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>