Move AWT link workaround to the top level CMake script so that it applied to tests.