Fixed broken JVM tests on OS X by endabling headless mode for AWT.

Review: https://reviews.apache.org/r/12236