Added signal handler for clean exit

BUG=
R=klm@google.com

Review URL: https://codereview.appspot.com/67040043