Mahela Jayawardene will step down as Sri Lanka's Test and one-day captain after the current tour of Australia.