Target has spent the past few years watching profits leak out of its stores as theft and other losses quietly eroded margins.