The Trustway Proteccio HSM can somtimes return a network error when
attempting to finalize the cryptoki library.
The error can prevent reinitialization because we attempt to finalize
the library before initalizing a new connection. When a network error
occurrs, barbican gets stuck in an error loop trying to finalize the
dead connection before starting a new one.
This patch adds code to ignore the network error when finalizing to
ensure we are able to attempt to reinitialize.
Connection errors during other operations will still result in 500
errors as expected.
Change-Id: I9ac6c7bbda0f81cb26e1c589803317df1ef11f39
(cherry picked from commit 70aac1f698)
(cherry picked from commit 1b6cf81c23)
(cherry picked from commit 2792aca796)
(cherry picked from commit 238b72caca)