Attempt 10 times to find a upnp database connection. Cache it into the session so we dont look it up every page load. Fixes a lot of issues with ajax calls