#2608 validate that locale is valid before starting

This branch is against the buildbot 0.8.9 branch.

Buildbot will now fail to start with a helpful message if a stray environment variable has broken ``locale.getdefaultlocale``.