Revert "Merge pull request #1616 from brandonsavage/revertproduct"

This reverts commit 38adc1bdfbe85b41c6d4731783bf88ccb687ddbc, reversing
changes made to 7cf4b111a82aaa7e373c0ac9653e8175b11aa326. It readds
fix for bug 923807 back into master.
Merge pull request #1618 from brandonsavage/reinstateproduct

Revert "Merge pull request #1616 from brandonsavage/revertproduct"
Fixes bug 929197 - Make sure connection closing can happen before doing it.
Merge pull request #1610 from AdrianGaudebert/929197-refactor-connection

Fixes bug 929197 - Make sure connection closing can happen before doing it.