[dm-thin] Fix bug in resizing of metadata

This bug was introduced in commit 4d36059b37206d5513321a5cc79b0cc246a3a635

When extending a metadata volume we:

- Switch the space map into a simple bootstrap mode, which allocates
  all space linearly from the newly added space.
- Add new bitmap entries for the new space
- Increment the reference counts for those newly allocated bitmap
  entries
- Commit
- Switch back out of bootstrap mode.

But, the commit may allocate space itself, if so this fact will be
lost when switching out of bootstrap mode.

The bug exhibited itself as an error when the bitmap_root, with an
erroneous ref count of 0, was subsequently decremented as part of a
later commit.  This would cause the commit to fail, and thinp to enter
read_only mode.  The metadata was not damaged (thin_check passed).

The fix is to put the increments + commit into a loop, running until
the commit has allocated no extra space.  In practise this loop runs
twice.