Fix ReferenceProperty circular event

Since ReferenceProperty registered for the changed event of the collection it is inside of,
it can generate a circular raiseEvent call that ultimately leads to a stack overflow.
We add a boolean to keep track of whether we raised the event we are in and ignore subsequent calls until we exit.
Better fix for RefereceProperty event crash

The logic in `ReferenceProperty._onCollectionChanged` was wrong and would
clear it's data and raise it's changed event when any entity other than
the targetEntity was removed from the targetCollection.  This fix reverts
the previous change and inverts the logic so that it's correct.
Merge pull request #2034 from AnalyticalGraphicsInc/circular-events

Fix ReferenceProperty circular event