Adjust thread count based on network connection and airplane mode.
Code review.
Merge pull request #141 from square/dimitris/network-state-change

Adjust thread count based on network connection and airplane mode.