Synchronized emulator shutdown for gradle integration.