Theoretical analysis of the RESET operation in phase-change memories