Enhanced retry middleware for Sidekiq