[desktop] Backport Django 1.5's ConditionalGetMiddleware to fix streaming bug

This fixes downloading csv files from beeswax.