Fix shutting down jetty container when running in daemon mode.

This fixes GRADLE-2263. The breakage occurred in 5ed4fa1f4cad.