format-patch: introduce helper function last_line_length()