Superconducting single-charge transistor in a tunable dissipative environment