Add logic to quit when a patch fails to apply, closes #46.