Fix the problem with exception after receiving msg from another source.

The exception is thrown when `event.data` is another type than string.
This is a case when using easyXDM and XDomain at the same time.