Ryan Harris took five wickets as Australia defeated hosts Sri Lanka in the first of their three Test matches.