Use literal_eval in JSONField when necessary.

JSONField would sometimes end up dealing with a string that was encoded
as a repr() of the object, instead of as a JSON serialization. In this
case, we used to use eval(). However, that's not ideal, and isn't very
secure.

Python 2.6+ offers literal_eval, which does what we need and is safer.
Older versions do not. For those versions, we ship the literal_eval
function from Python 2.7.

We also do a better job of sanitizing the resulting content before
returning to the caller in this case, helping to prevent failures with
loading pages and fixing the problem.
Release Djblets 0.6.30.
Merge branch 'release-0.6.x' into release-0.7.x
Release Djblets 0.7.19.