balance_pool: Fix race between checking for empty dir and grabbing lock

MFH