test: Fix check-terminal race in integration test