Updated ref counting to remove accessed shards from the list of ones to close. Updated the close to close as many as it takes to get below the leve