On the treatment of resonances in next-to-leading order calculations matched to a parton shower