Fix issue 10949 CTFE ICE after indexing error

When an error occurs during optimize(), propagate the ErrorExp.
Merge pull request #2513 from donc/ice_arraybounds

Regression 10949: CTFE ICE after indexing error