Long-time accuracy of ensemble Kalman filters for chaotic and machine-learned dynamical systems