The otatool pytest closes the serial port and then immediately launches
otatool_example.py as a subprocess that re-opens the same port via
esptool. This fails intermittently because pytest-embedded's
QueueFeederThread may still hold the FD when close() returns, and the
OS has not fully released the serial port by the time the subprocess
tries to open it.
Add a delay after serial close and a 3-attempt retry loop around the
subprocess to handle transient serial port contention.
(cherry picked from commit 926d5ee6ad)