Masking faults in memories by using spares or by reconfiguring