Handle an 'offline' event. Fixes #76.