Check type of socket emit result

Socket emit handler crashes when it tries to parse result which is already an Object.