Effects of electrode polarity on filament ruptures during unipolar resistance switchings