Analysis of k-Nearest Neighbor Distances with Application to Entropy Estimation