Fix a possible traceback in eclipse script

Inside onTextInserted we need to check if the event.source is text area
before try to get characterCount.