Blue Devils upset by Bulldogs in 27-24 thriller