[frontend] fix traceback when forking
I'm not sure why, but I got this traceback error:
InvalidRequestError: This session is in 'committed' state; no
further SQL can be emitted within this transaction.
But anyway, it looks like the fork job should be committed once it
is completely done. Instead of commit() for each forked build,
let's explicitly flush() now (per discussion in PR #16).