Fixes Error when contain Non-ascii in template

when set template use non-english resource_name and execute
"heat -v resource-list $stack_id". KeyError will occur because
heat can not encode it correctly. This patch will implement
a process to encode the resource_name.

The patch use a new module (strutils.py) taken from
oslo-incubator in order to use safe_encode() and
safe_decode(), and this module is useful for future
patchs.

Change-Id: Idddda20d96bca32cb4df94ede31b40f7141e3afe
Closes-Bug: #1249238
Merge "Fixes Error when contain Non-ascii in template"