Short-circuit set_locale when context is the same.

No need to do duplicate work when setting the same locale repeatedly

fixes #1