v3 credentials, ensure blob response is json

The v3/credentials API specifies the blob response to be json, but
due to bug #1259584, any credentials stored via the ec2tokens extension
will incorrectly return a dict.  This makes it hard for clients (and
in particular users migrating from ec2tokens to v3/credentials) to
handle the blob data consistently, so add a workaround to ensure the
response is always serialized as json if the existing DB contents is
a dict instead of a json string.

Change-Id: I340cdf4e565fdadacb41b39acace3948aafb9b92
Related-Bug: #1259584
Closes-Bug: #1269637
Merge "v3 credentials, ensure blob response is json"