make NEWS-update.jl more robust in trimming existing links (#59305)
The `NEWS-update.jl` script trims away any existing links from the end
of the `NEWS.md` file, so that it is safe to run multiple times. This PR
makes that trimming a bit more robust by trimming only `[#...]:`
patterns that start at the beginning of a line.
(I ran into this in re-using the same script for another project.)