Ab initio investigation of structural stability, magnetic ground state, and mechanical anisotropy of the CoCrFeNi high-entropy alloy