Add option to delete the emulator after build only if the build did not succeed

see: https://issues.jenkins-ci.org/browse/JENKINS-15928

This will also add the ability to delete emulator on jobs which use snapshots in case the emulator fails to start (since using startups is unreliable at the moment).