dsdb: Take out the transaction and prepare_commit locks in the same order