Method for multilevel programming of phase change memory cells using adaptive reset pulses