Gritty McIlroy hangs in to retain the Masters