setlocale: Use the heap for the copy of the locale argument

This avoids alloca calls with potentially large arguments.

(cherry picked from commit d183645616b0533b3acee28f1a95570bffbdf50f)
_nl_find_locale: Improve handling of crafted locale names [BZ #17137]

Prevent directory traversal in locale-related environment variables
(CVE-2014-0475).

(cherry picked from commit 4e8f95a0df7c2300b830ec12c0ae1e161bc8a8a3)

Conflicts:
	NEWS
	localedata/Makefile
manual: Update the locale documentation

(cherry picked from commit 585367266923156ac6fb789939a923641ba5aaf4)

Conflicts:
	manual/locale.texi