[devil] Add SignalHandler and reset previous signal_handler in a finally.
[devil] Add SignalHandler and reset previous signal_handler in a finally.

BUG=chromium:664308

Review-Url: https://codereview.chromium.org/2505383002

catapult-project/catapult,benschmaus/catapult,benschmaus/catapult,catapult-project/catapult,sahiljain/catapult,benschmaus/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult-csm,catapult-project/catapult-csm,catapult-project/catapult-csm,catapult-project/catapult-csm,catapult-project/catapult-csm,catapult-project/catapult,catapult-project/catapult,benschmaus/catapult,sahiljain/catapult,sahiljain/catapult,benschmaus/catapult,catapult-project/catapult,sahiljain/catapult,benschmaus/catapult,catapult-project/catapult-csm,sahiljain/catapult,sahiljain/catapult,catapult-project/catapult-csm,benschmaus/catapult