Bump minimum Boost ver to 1.40.

This means we don't have to use the Boost Foreach workaround on Linux.

Our minimum Ubuntu version (precise) and minimum Debian version (wheezy)
both ship later versions of Boost, so this is safe.
Trim trailing whitespace.