Encode values as utf-8 before encrypting

Ensure strings are correctly encoded before encrypting

This is necessary because some encryption libraries don't handle
the unicode conversion appropriately.

Also includes "tolerate None values to _encrypt" fix from
bug #1237596, without which the grizzly unit tests fail

Conflicts:
    heat/db/sqlalchemy/api.py
    heat/heat/tests/test_sqlalchemy_api.py

Combination of these Change-Id's,
Iebbf32e57ba21d955c1984ee32360379579366c8
I39cd4a1bab39def9ad4c214da768e91f411d7697
with a partial backport (one test) from
Ie0fdc5068475db7e84f366d1eb2b9ae56db0b3fc
to ensure test-coverage of the bugfix.

Closes-Bug: #1237596
Closes-Bug: #1207707
Change-Id: I1efaedc983b60a01944d5ebf88084f52ba909e78