Hoist the use of this private API to a single location in a helper function.

#7662


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/branches/banana-receive-wrong-dialect-7662@43221 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb