am 1791eefd: fix a couple race-conditions in RefBase::promote()

* commit '1791eefd69e07a7d8a311ee8a298bbd2de77f046':
  fix a couple race-conditions in RefBase::promote()