The M 4 Core Project with HST - IV. Internal kinematics from accurate radial velocities of 2771 cluster members