Fix exception opening file

Based on the stack trace in this issue it appears another component
triggered a new layout inside the initial LayoutChanged event of an
IWpfTextView.  This change causes the initial mode change logic to
detect this and wait for the next LayoutChanged event before setting up
the initial mode

closes #1376