Fix the revision race check

With commit 62fabf3a65d the revision update was move to a place after the race
check. So we need to check for old_rev > new_rev now.
Merge pull request #1064 from rhafer/race_check

Fix the revision race check