England won the first Ashes Test against Australia by just 14 runs on an unbearably tense final day at Trent Bridge.