Add sidekiq_job_attempt_threshold config variable

The same idea as Tadas Tamosauskas's commit, but implemented differently and for Sidekiq. I am happy to make whatever changes you'd like.