fix race in synchronize example

Link: https://github.com/GeneAssembly/biosal/issues/320
Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>