Use correct APIs when switching primary identity
Use correct APIs when switching primary identity

The NewCredWizard class examines the primary identity and changes it
if the primary identity has a parent.  KeyStores that contain keys for
a derived identity are indicated as being parents of the derived
identity.  When new credentials are being obtained for a derived
identity, this mechanism switches the primary identity to the KeyStore
so that only the KeyStore password is required.

The switch used to be done manually based on the assumption that there
was only one primary identity and was not thread safe.  Replace the
logic with a thread safe API call that doesn't make an assumption
about the number of identities involved.

Change-Id: If8b577ba6c26eee96cf2e917743548be1e88d76e

secure-endpoints/netidmgr,secure-endpoints/netidmgr,secure-endpoints/netidmgr,secure-endpoints/netidmgr,secure-endpoints/netidmgr