[autotest] Throw on sigterm when locking machines.

If the python process receives a sigterm while machines are locked, the
machines will never be unlocked. If we translate the signal into an
exception, then the standard python cleanup mechanisms can apply, and
all will be well.

BUG=chromium-os:33094
TEST=pylint+unit

Change-Id: Ifdd96df1fef809da9618e47d7361c290e29cdd76
Reviewed-on: https://gerrit.chromium.org/gerrit/29321
Tested-by: Alex Miller <milleral@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Ready: Alex Miller <milleral@chromium.org>
diff --git a/client/common_lib/error.py b/client/common_lib/error.py
index d9047c8..0702f67 100644
--- a/client/common_lib/error.py
+++ b/client/common_lib/error.py
@@ -544,6 +544,12 @@
     pass
 
 
+class SignalException(CrosDynamicSuiteException):
+    """Raised when the dynamic scheduler receives a terminating signal during
+    execution of the tests."""
+    pass
+
+
 # This MUST remain at the end of the file.
 # Limit 'from error import *' to only import the exception instances.
 for _name, _thing in locals().items():