[distance] fix bug in point-box distance computation in range-to-segment/box code