Fixes to the caching logic to prevent unhandled exceptions and incorrect log messages.

The caching logic was in the wrong place and not properly wrapped in
begin/rescue blocks. A permissions problem to any of the files in the
Long or Short term cache would cause the plugin to fail rather than
properly contacting the API service and retrieving the secret directly.

This patch wraps all of the cache calls in getSecret() with begin/rescue
blocks and provides appropriate logging around them to let you know when
there's a failure in your caching.

If the short-term cache fails, the secret will be retreived from the API
services. If the API services subsequently fail, the secret will be
retreived from the long-term cache. If the long-term cache fails, an
appropriate exception is raised. If the long-term cache succeeds, we
actually return the secret now properly.

We also have moved the 'cache this secret' logic outside of the big
begin/rescue block and into its own dedicated block right before we
return the secret_hash values. This is cleaner to read, and prevents an
exception at this point triggering the 'get secret from long term cache'
rescue block, which it was doing before.

Change-Id: Ic71b22d6d39272b638ef54dde1408df34d1ecc05