DETROIT — Dwane Casey did not stay out of the NBA for long. A month after being fired by the Toronto Raptors, Casey agreed to a five-year deal to become head coach of the Detroit Pistons, two people familiar with the situation said Monday. The people spoke on condition of anonymity because the team had not announced the move, which first was reported by ESPN. Casey led Toronto to a franchise-record 59 wins this year and helped it earn the top seed in the Eastern Conference for the first time. The NBA Coach of the Year finalist was fired shortly after The Raptors were swept by the Cavaliers with one year remaining on a three-year, $18 million extension.