Add input_finished to ShardState and force a new slice just for finalization.

Right now if output writer finalization fails we will retry so of the input
items. We shouldn't assume anything about the output writer so we probably
shouldn't write to it after finalizing.

This change forces a checkpoint after all the input is processed and ensures
that no more input will be processed after finalization is called.

Revision created by MOE tool push_codebase.
MOE_MIGRATION=7105