format-patch: refactor get_patch_filename