Adding common.utils.exception_to_str() to avoid encoding issue

1. Ported common.utils.exception_to_str() back to glance_store.
2. Used exception_to_str() to consistently cast the exception to avoid
potential encoding issue.

Change-Id: I398ea0e218ebb37b9041cfe82f18b11e614662bf
Related-Id: I77478a8eeeefd85bf98138156429df53d0a4c079
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Merge "Adding common.utils.exception_to_str() to avoid encoding issue"