Rory McIlroy came within 10 minutes of missing his tee time in bizarre circumstances on the final day of the Ryder Cup at Medinah.