Make supervisor setup more reliable
Make supervisor setup more reliable

There was a race condition when setting up the supervisor such that in
some cases it was possible to miss a signal when the parent process
died.  We could reproduce this with by running a "snabb lwaftr bench",
but only on our test machine with two NUMA nodes and only when setting
--cpu on the lwaftr.  In that case the problem would appear when
running "snabb lwaftr monitor" on the lwaftr; the monitor process
would hang reading from the signalfd.  Because the monitor process
still had stdout open, then when piping its output to "grep", the grep
process would hang because the write side of its stdin pipe would
still be open as well.

This patch fixes this error by making cleanup reliable.  It does so by
taking a POSIX lock on an unnamed file in the parent, then taking
another lock from the supervisor child process.  In this way we avoid
some of the more arcane parts of Linux.

dpino/snabbswitch,alexandergall/snabbswitch,dpino/snabb,eugeneia/snabb,snabbco/snabb,snabbco/snabb,dpino/snabb,snabbco/snabb,Igalia/snabbswitch,alexandergall/snabbswitch,eugeneia/snabb,dpino/snabb,eugeneia/snabbswitch,Igalia/snabbswitch,Igalia/snabb,eugeneia/snabbswitch,SnabbCo/snabbswitch,Igalia/snabbswitch,alexandergall/snabbswitch,alexandergall/snabbswitch,Igalia/snabbswitch,eugeneia/snabb,snabbco/snabb,alexandergall/snabbswitch,alexandergall/snabbswitch,dpino/snabbswitch,eugeneia/snabb,Igalia/snabb,dpino/snabb,eugeneia/snabb,eugeneia/snabbswitch,Igalia/snabb,snabbco/snabb,snabbco/snabb,Igalia/snabb,dpino/snabb,dpino/snabb,Igalia/snabb,SnabbCo/snabbswitch,Igalia/snabb,Igalia/snabbswitch,alexandergall/snabbswitch,eugeneia/snabbswitch,dpino/snabb,Igalia/snabb,alexandergall/snabbswitch,eugeneia/snabb,dpino/snabbswitch,eugeneia/snabb,dpino/snabbswitch,SnabbCo/snabbswitch,SnabbCo/snabbswitch,Igalia/snabb,snabbco/snabb,snabbco/snabb,eugeneia/snabb