Carbon foams prepared from polyimide using urethane foam template