Eliminate some nested repetitions in regexps

Nested repetitions such as (A*)* potentially take exponential time but
can usually be rewritten in a faster and more readable way without
much trouble.  These were all found by Relint.

* lisp/obsolete/terminal.el (te-parse-program-and-args):
* lisp/org/org.el (org-make-tags-matcher):
Apply the transform (A+B*)+ -> A(A|B)*

* lisp/textmodes/fill.el (adaptive-fill-regexp):
Apply the transform A*(B+A*)* -> (A|B)*

* lisp/progmodes/idlw-shell.el (idlwave-shell-filter):
Find the last newline or CR in a more direct way.

* lisp/progmodes/vhdl-mode.el (vhdl-port-copy, vhdl-subprog-copy):
Trim trailing whitespace from a string in a more direct way.
All-whitespace strings are left unchanged as before.
4 jobs for master in 16 minutes and 57 seconds (queued for 26 seconds)
Status Job ID Name Coverage
  Normal
passed #76251
test-lisp-obsolete-inotify

00:10:31

passed #76252
test-lisp-org-inotify

00:10:36

passed #76253
test-lisp-progmodes-inotify

00:16:36

failed #76254
test-lisp-textmodes-inotify

00:05:54

 
Name Stage Failure
failed
test-lisp-textmodes-inotify Normal
$ find ${test_name} ! \( -name "*.log" -o -name ${EMACS_TEST_JUNIT_REPORT} \) -type f -delete
find: test-lisp-textmodes-inotify-67977ae5: No such file or directory
Uploading artifacts...
WARNING: test-lisp-textmodes-inotify-67977ae5/: no matching files
ERROR: No files to upload
Uploading artifacts...
WARNING: test-lisp-textmodes-inotify-67977ae5/junit-test-report.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1