Ryan Hedges nets an injury-time winner as Barnsley win a high-scoring EFL Cup tie against League Two side Morecambe.