Fix `WAIT_IN_STAGE` mechanism which times out after 5 min.
Fix `WAIT_IN_STAGE` mechanism which times out after 5 min.

`after_script` apparently has a hardcoded timeout of 5 min, which
cannot be changed. Luckily `trap` works in Gitlab scripts if we
execute the whole script in a subshell, so use that to trap shell exit
and wait inside the `script` section instead.

There is a contribution to Gitlab open which fixes the issue without
using a subshell, but this is not merged at the time of writing:
https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/971

Signed-off-by: Kristian Amlie <505e66ae45028a0596c853559221f0b72c1cee21@northern.tech>

mendersoftware/meta-mender-qemu