Technology Aware Training in Memristive Neuromorphic Systems based on non-ideal Synaptic Crossbars