Corrected CustomMiddleware example

Just reading through the docs and noticed some minor corrections needed in `extend.rst`.