cpu: Drop unnecessary dynamic casts in *_env_get_cpu()