Sunderland go fourth in the Premier League table after coming from two goals down to beat Bournemouth 3-2 in torrential rain.