The Statistical Accuracy of Neural Posterior and Likelihood Estimation