Swansea City ended its long wait for a win in the EFL Championship, upsetting Bristol City with a 1-0 win at Ashton Gate.