Klay Thompson scored 27 points, and the Golden State Warriors pulled away late to beat the Detroit Pistons.