The country’s sheriffs are nearing an agreement with the federal Department of Homeland Security that would let them act as contractors to hold illegal immigrants in jail for pickup, hoping they have found a way to handle the increasingly tricky issue of immigration detention requests. Rather than holding immigrants on their own authority, the sheriffs say,…