Fix job pruning.

We added different types of job pruning some time ago but it seems that
the JobType argument to prune_jobs() is just ignored and only Backup
jobs are pruned. This is a first attempt at really implementing pruning
of different Job types.
Merge branch 'mvw/pruning'