The Roles of Morphology and Environment on the Star Formation Rate–Stellar Mass Relation in COSMOS from 0 < z < 3.5