[Bug 1111572] patch segfaults if it can't write *.orig