[btr] fix for the DEBUG-COSTMAP predicate:

it used to cause a recursive mutex lock