Sync gettextutils from oslo

Add type check for Message params when setting locale to avoid
AttributeError.

Fixes bug: #1229364

Change-Id: I6fe55ebc4eea5fef1d335ad83a84c4879f7f06f9
Merge "Sync gettextutils from oslo"