The impact of within-host interactions and priority effects on disease dynamics in coinfected populations