Avoid race conditions during bedprep work on samples with shared input BED files. Fixes #595