Obey --with-locales here, too

Avoid linking in various functions and potentially largish data
objects if the corresponding locale is deliberatedly skipped by using
the --with-locales configure option.

Change-Id: I8ec8c2b6176972d048a3c0e180ac0e6e805f2378