Two-Sample Tests Based on Geometric Graphs: Asymptotic Distribution and Detection Thresholds