Resolve #89 by adding an optional max number of retries to connectToAP function.
Fix problem with m_localPool and m_globalPool

m_localPool and m_globalPool are somehow getting cleared after being
set in the constructor.
synchronizing with Adafruit master