Add more tests for branch creation.

Branch could not be created right after out-of-branches garbage update.
Fix branch creation after garbage removal.

It wasn't possible to correctly create branch after
top-level out-of-branches garbage update.
branch_t now stores last revision affected this branch.