Prevent take_screenshot from masking exceptions

In several places a screenshot is captured after a test has failed
and raised an error.TestFail. If the screenshot also fails (e.g.
because the X server has crashed) its exception will currently mask
the earlier test failure.

This change modifies take_screenshot so that it will only raise an
exception if one is not already being processed. Otherwise, it will
log its local failure and allow the exception handling to continue.

Tested with login_CryptohomeIncognitoUnmounted by running 'stop ui'
before the screenshot. After a successful login, the screenshot
exception is raised as usual. While processing the exception from a
failed login, the screenshot's failure is only logged.

BUG=chromium-os:37461
TEST=None

Change-Id: Ic66292932727473bc94b7b78fc78d3bb0c63937e
Reviewed-on: https://gerrit.chromium.org/gerrit/41847
Reviewed-by: Mark Koudritsky <kamrik@chromium.org>
Commit-Queue: Chris Wolfe <cwolfe@chromium.org>
Tested-by: Chris Wolfe <cwolfe@chromium.org>
1 file changed