Check CFStringTransform() call for success before using result

CFStringTransform returns a Boolean to report success/failure, and the string should probably only be used on success. Assuming CFStringTransform is well-behaved, the end result is likely the same.

In any case, our lovely security analysis tool flagged this as a must-fix failure to check error conditions before using a function result, so it seemed worth a pull request.

See matching request #1866 for the 1.x branch.