A cosmic ray cocoon along the X-ray jet of M87?