Laboratory investigation of some ion–molecule reactions related to cyanide chemistry in dense interstellar clouds