add assertion in RulesApplicator

Bail out if we try to remove an input artifact of a rule while applying
this rule. This indicates a serious flaw of the calling code.

Change-Id: I19110ececa02e5a795474a99f5ba911e4d2c9faa
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
fix occasional crash when applying dynamic rules

When creating the set of input artifacts we must not include compatible
artifacts that have been created by this rule.
This can e.g. happen for the ["cpp", "hpp"] to ["hpp", "cpp", "unmocable"]
rule and led to occasional crashes in TestBlackbox::track_qobject_change.

Change-Id: I8bf5e8285fa22c8ec89619fb7d3bec60b9797ef0
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>