Combined reactions and separations using ionic liquids and carbon dioxide