Fix end iterator dereference in CFGMutation
Fix end iterator dereference in CFGMutation

Summary:
Running `RemoveUninstantiablesPass` end-to-end exposed a potential end iterator
dereference issue when replacing an instruction and testing how far ahead the
iterator needs to be in incremented to prepare for invalidate.

The following things need to occur to reproduce the issue:

 - The target instruction is the very last instruction in the CFG (last block,
   and last instruction in that block).
 - It could potentially have a move result.
 - But the move result is not present in the CFG, for some reason.

In this case, we will incorrectly try to increment past the end iterator.

Fix is to check whether we are already at the end.

Reviewed By: emma0303

Differential Revision: D18466935

fbshipit-source-id: 927d9d6c9ed32f7773fdd5241b48425b2812fe77

facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex