Capture createrepo_c stderr in case of nonzero return
Use Python future for repo_done event

In the previous implementation when a thread died because of an exception,
we were stuck. Futures can propagate exceptions back to parent, where they will
be handled apropriately.
Readd eager repo_done execution
Use connection() instead of get_bind()

get_bind acquired a new connection, so the query was executed outside of the
main transaction
Do bulk insert for dependencies