element.py: Discard __artifact/__strict_artifact in update_state()
When we determine that current cache keys are to be discarded, we should also discard the associated members for correctness. This should act as a safeguard against accessing Artifact instances that have discarded cache keys. A side effect of this is the querying of element buildtree state from cli methods on elements that don't have a cached artifact would lead to the artifact member methods not being reachable. Ensuring the element is cached before trying to call said accessor methods resolves this.
Showing with 12 additions and 10 deletions