Store cherry pick state before running pre-commit hooks

Similar to 6c5a7b7, add support for storing/restoring cherry pick state
during a hook run.

This is done by checking for the existence of the `CHERRY_PICK_HEAD`
file in the `.git` directory and saving it, restoring it if we saved it.

Integration test included for good measure.

Change-Id: I14ee660a84bef3d31b9ce8121c3ec7442e4a58df
Reviewed-on: http://gerrit.causes.com/38444
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>
Cut version 0.11.1

Change-Id: I428b574c32aacb5320361d7a8ebb9a2bcefa314c
Reviewed-on: http://gerrit.causes.com/38445
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>