[Version Control] Implemented support for cancelling checkout.

Also fixes bug 13819.