refactor(expect): wait for SIGINT or EOF when holding UARTs

This change allows any Expect scripts that include the `uart-hold.inc`
to terminate with success upon reception of either EOF or the SIGINT
(Ctrl+C) signal. The former is necessary for the OpenCI, and the latter
for the on-premises CI.

This change also introduces the `terminable.inc` Expect script fragment,
which adds a trap handler for the SIGINT signal (Ctrl+C) which will exit
the Expect script with success. This is useful for scripts that work
around SDDKW-43675, where the model hangs if UARTs which generate a lot
of output are not flushed frequently.

The `handle-arguments.inc` fragment has been updated to ignore SIGINT so
that other terms are not terminated prematurely.

See: https://jira.arm.com/browse/SDDKW-43675

Signed-off-by: Chris Kay <chris.kay@arm.com>
Change-Id: Icb106b60409c4e3be2b025fa1d4550af3acb57be
(cherry picked from commit 5e3449fb519a603c7000c9bf76261fe4fe415c33)
diff --git a/expect/terminable.inc b/expect/terminable.inc
new file mode 100644
index 0000000..a96d51a
--- /dev/null
+++ b/expect/terminable.inc
@@ -0,0 +1,10 @@
+#
+# Copyright (c) 2022 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+trap {
+    puts "<<received SIGINT, exiting>>"
+    exit_uart 0
+} SIGINT