Fix bug 958278 - only insert asset middleware when static asset serving ...

...is enabled