Remove spurious endif() in UseLocale.cmake
Use defined() to avoid empty macro expansion errors