Try_Jobdir: fix a race condition

Wait for the sourcestamp to be written in the database before adding a buildset
that refers to it.
Merge delroth/buildbot:tryjobdir-race-condition (PR #1108)