Fix race condition in marionette tests