Reapply "[APINotes] Prefer diff -u over diff -b" (#157894)
This reverts commit 8d35bcc52117b79517f518de952b4b50463de160.
This was causing failures on MacOS due to the head command there not
supporting negative offsets. This patch fixes that by removing the call
to HEAD and relaxing the requirements around removing the last line of
the file.