When creating a new connection use the same query

When a new control connection is made the system.peers table and system.local table are queried multiple times before the control connection is established. This patch combines the queries to each table by using "preloaded" results. This seemed like a minimal way to make the change, but might not necessarily be the best way. Let me know if you feel like a different approach should be used.