onUnsubscribe is currently only called when a subscription is formally cancelled by the user. If a socket error closes the connection, the subscription isn't alive anymore, but because onUnsubscribe isn't triggered there's no good way of knowing that this event was omitted.
I've currently worked around it using ARC retain/release calls. On deinit of a reference type, the onUnsubscribe is implied, though I'm not even certain that this works in practice.