How to iron out rough landscapes and get optimal performances: Averaged gradient descent and its application to tensor PCA