Fixes a couple of concurrent resizing bugs

 - Fixes race condition between multiple resize ops, where smaller resize op can come in late and fail.

 - Fixes concurrent race between recording and resize, where new countsArrayLength could be exposed prematurely.