agnosticbin: Fix race conditions in tests

Change-Id: Ie16afa652f69f47784f69d7b00cdd6f45f5559b3