The three-loop unpolarized and polarized non-singlet anomalous dimensions from off shell operator matrix elements