Update settings to add ImpersonationMiddleware to middleware_classes if it exists.