[PATCH v3 01/11] test: Correctly match "background" with "wait" commands