NetStats: Don't update stats when screen is off

Also moved registering of broadcast receiver and settings
observer to onAttachedToWindow() and unregistering to
onDetachedFromWindow() to avoid these being leaked.