Instead, ensure every middleware gets a reference to the final WSGI
application. Note that this reimplements much of paste.deploy's pipeline
handling, but that code hasn't changed in years, anyway.
Change-Id: I2fbb21cabf72849ce84760a6d2607aa2af67f286