Change directory with test driver for older CMakes

The WORKING_DIRECTORY property wasn't added until 2.8.4; for versions
earlier than that we provide a work-around. On newer versions we set the
property since some other components may use it.