Roku posted its first profit since 2021 as ad sales and streaming growth boost platform revenue and lift full-year outlook.