Aberdeen ended their run of six matches without a win as second-half goals by Adam Rooney and Jonny Hayes snuffed out the weak challenge of Dundee United.