Fix pending messages and deliver offline storage after subscribed (should close #103)

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>