Senior German conservatives facing painful losses in two state elections this month have ruled out forming coalitions with the far-right Alternative for Germany (AfD) party.