ci/bare-metal: races accessing serial
In normal operation, it seems that the write-serial.py from a previous job is always terminated before a new job starts. However, occasionally we see:
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
which in every instance I saw while setting up the CI system was due to multiple access (and I've never seen these serials disconnected in the dmesg of the runner). The particular job I just saw it on was just after a mid-run cancelled pipeline -- perhaps when the pipeline gets cancelled, the gitlab-runner doesn't wait for the old container to exit before starting the new job? https://gitlab.com/gitlab-org/gitlab-runner/-/issues/6359 may be related.