Optimise let and let* whose body is constant or the last variable

Simplify  (let ((X1 E1) ... (Xn En)) Xn)
      =>  (progn E1 ... En)

and       (let* ((X1 E1) ... (Xn En)) Xn)
      =>  (let* ((X1 E1) ... (Xn-1 En-1)) En)

and similarly the case where the body is a constant, extending a
previous optimisation that only applied to the constant nil.
This reduces the number of bound variables, shortens the code, and
enables further optimisations.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-letX): Rewrite using
`pcase` and add the aforementioned transformations.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
5 jobs for master in 1 minute and 34 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Prep Images
failed #24390
prep-image-base

00:00:16

 
  Build Images
skipped #24391
build-image-inotify
 
  Fast
failed #24392
test-fast-inotify

00:00:26

 
  Normal
failed #24393
test-lisp-inotify

00:00:13

failed #24394
test-lisp-net-inotify

00:00:50

 
Name Stage Failure
failed
test-lisp-net-inotify Normal There has been a runner system failure, please try again
Initialized empty Git repository in /builds/emacs/emacs/.git/
Created fresh repository.
From https://emba.gnu.org/emacs/emacs
* [new ref] 52a55e11deb7822c67a8d7e6f2544b8f41d25a4e -> refs/pipelines/11644
* [new branch] master -> origin/master
Checking out 52a55e11 as master...

Skipping Git submodules setup
ERROR: Job failed (system failure): Error response from daemon: Conflict. The container name "/runner-2oEDrUT7-project-1-concurrent-2-build-4" is already in use by container "da1fe579c662349f5b0cbedeaf385ca8567e208eca419e08e6d3defd24c4f2dc". You have to remove (or rename) that container to be able to reuse that name. (executor_docker.go:726:0s)
failed
test-lisp-inotify Normal There has been a runner system failure, please try again
Using docker image sha256:81f5749c9058a7284e6acd8e126f2b882765a17b9ead14422b51cde1a110b85c for docker:19.03.12 ...
Running on runner-2oEDrUT7-project-1-concurrent-1 via emba.gnu.org...
$ git config --global http.proxy $HTTP_PROXY; git config --global https.proxy $HTTPS_PROXY
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/emacs/emacs/.git/
Checking out 52a55e11 as master...

Skipping Git submodules setup
ERROR: Job failed (system failure): Error response from daemon: Conflict. The container name "/runner-2oEDrUT7-project-1-concurrent-1-build-4" is already in use by container "f46df44a43bee1f61a6ede2eac732a4e06eaa2094659f7ea23718f093d67bcc6". You have to remove (or rename) that container to be able to reuse that name. (executor_docker.go:726:0s)
failed
test-fast-inotify Fast There has been a runner system failure, please try again
Using docker image sha256:81f5749c9058a7284e6acd8e126f2b882765a17b9ead14422b51cde1a110b85c for docker:19.03.12 ...
Running on runner-2oEDrUT7-project-1-concurrent-1 via emba.gnu.org...
$ git config --global http.proxy $HTTP_PROXY; git config --global https.proxy $HTTPS_PROXY
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/emacs/emacs/.git/
Checking out 52a55e11 as master...

Skipping Git submodules setup
ERROR: Job failed (system failure): Error response from daemon: Conflict. The container name "/runner-2oEDrUT7-project-1-concurrent-1-build-4" is already in use by container "f46df44a43bee1f61a6ede2eac732a4e06eaa2094659f7ea23718f093d67bcc6". You have to remove (or rename) that container to be able to reuse that name. (executor_docker.go:726:0s)
failed
prep-image-base Prep Images There has been a runner system failure, please try again
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/emacs/emacs/.git/
From https://emba.gnu.org/emacs/emacs
* [new ref] 52a55e11deb7822c67a8d7e6f2544b8f41d25a4e -> refs/pipelines/11644
5fb8b20..52a55e1 master -> origin/master
Checking out 52a55e11 as master...

Skipping Git submodules setup
ERROR: Job failed (system failure): Error response from daemon: Conflict. The container name "/runner-2oEDrUT7-project-1-concurrent-1-build-4" is already in use by container "f46df44a43bee1f61a6ede2eac732a4e06eaa2094659f7ea23718f093d67bcc6". You have to remove (or rename) that container to be able to reuse that name. (executor_docker.go:726:0s)