Libya detains 4,000 people in anti-migrant crackdown