Array of Josephson junctions with a nonsinusoidal current-phase relation as a model of the resistive transition of unconventional superconductors