Leinster held off a stirring Ulster fightback to climb to third place in the United Rugby Championship courtesy of a thrilling 29-21 bonus-point win in Belfast.