(bug 37072) - prevents infinite job loop
nextJob.php does not honor jobs types being excluded from the default
job queue by using $wgJobTypesExcludedFromDefaultQueue. Since those jobs
can never get processed, nextJob.php will always return a database which
might produce a nasty infinite loop while trying to process the whole
queue.
Job::pop did take in account wgJobTypesExcludedFromDefaultQueue to
filter the jobs out. So this patch factor out the code in a new method
and uses it for nextJob.php.
Change-Id: I15197ffcca00f229c9004e2abd87e009bc40f384