Diff.xs: Detect patches() calling context