Voltage-controlled cycling endurance of HfOx-based resistive-switching memory