Resistive-Switching Memory Devices Based on Metal Oxides: Modeling of Unipolar Switching, Reliability, and Scaling