Reliability of Logic-in-Memory Circuits in Resistive Memory Arrays