Move key_handles to the inner try block.
Move key_handles to the inner try block.

If an HSM was taken down and the keyhandles of
a referenced key changed for whichever reason,
we will find the key again, when the HSM comes up
again.

Closes #1278

privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea