Coded an override_locale context manager for use in tests.

The manager handles changing the locale in a thread-safe way and skips
the (whole) test in which it is used if the locale is not available.
With Python 3 may also be used as a decorator.

Note that for a locale to be available it must be installed for the
operating system. On *nixes you you may check what is available using
"locale -a" and for instance on Ubuntu add more locales using "apt-get
install language-pack-xx".
Added a test case for the set_cookie encoding issues.
Helped syntax checker with file encoding declarations.

PEP-263 states that "If a Unicode string with a coding declaration
is passed to compile(), a SyntaxError will be raised" (under
"Implementation"). However. compile() can deal with Unicode
strings, just without the declaration.
Django 1.4 and Python 2.6 compatibility for the set_cookie changes.