Try to fix mapping-test

The mapping-test is failing under gnome-continuous. I suspect this
is simply due to running many tests in parallel, and mapping-test
being racy. Replace the blind sleep by signals, to avoid the
races.