Take more care to only set NEED_SWITCH once when a chunk becomes full.