The agreement heads off what would have been Mr. Icahn’s third proxy contest in three years at Biogen.