Hanson holds off McIlroy to win BMW Masters