Only $apply callbacks if not already in digest cycle

With Socket.IO, it's possible that an event can chain into other events, thus firing multiple callbacks. In this case, the service will call `$rootScope.$apply` even though we're already inside the scope lifecycle.

This patch introduces a check on `$rootScope.$$phase` to decide whether or not to execute the callback via `$apply`. The code is based on a StackOverflow question I answered regarding this issue: http://stackoverflow.com/questions/14700865