Hungarian police detain over 9,000 refugees