Gamma-rays and cosmic rays from a pulsar in Cygnus OB2