This fixes an anomaly with regards to actual shard count vs. primary shard count.

This prevents unnecessary optimize calls (that did nothing since the indices may already have been reduced to the proper number of segments) and logging chatter.