Error during component install from tag fixed.

* Local repository tags are removed after required
  branch/tag is checked out, but not before.
* Additionally, we check that tag with the same commit
  reference as for the branch is not removed during tags
  cleanup to prevent broken local repository.

Closes-Bug: #1243154
Change-Id: I3f54f25ce5ed92b9f1cf227cc0d85657d4661692