fix data race in test

Signed-off-by: Johannes Petzold <jpetzold@pivotallabs.com>