builtin-am: implement committing applied patch