C++: Compatibility workrounds for Boost.Filesystem 1.46 and earlier

Testing: Should compile and link with Boost 1.46.  Travis and the CI builds should all be green, but since they all use later Boost versions, they won't pick up on any problem here.