Solution to the B→πK puzzle in a flavor-changing Z′ model