base: wsgi middlewares reorganization

* Fixing DebbugedApplication middleware usage.

* Using an Apache environment variable to detect when to apply
  the WSGIScriptAliasFix.

Signed-off-by: Yoan Blanc <yoan.blanc@cern.ch>