pg_upgrade: make the locale comparison more tolerant

https://commitfest.postgresql.org/action/patch_view?id=1355
http://archives.postgresql.org/message-id/10152755.SVtzXS2QiT@nb.usersys.redhat.com