Cache invalidation: setup script prefix before running the job

Turns out now this is now executed in a separate process as if it was a
Django management command, and therefore suffers from the same issue
`refresh_stats` has (Django ticket 16734). Therefore, it's necessary to
call the `set_script_prefix()` function for deployments were
`FORCE_SCRIPT_NAME` is being used.

Fixes #296.