How to detect a race attack and re-spend the already-spent outputs?
As Doug said in the question comments (posted here as an answer by his request):


  If there is at least 1 conf by the network, a race-based double-spending attack is not possible.


Therefore the attack he describes is a fork-based double spend similar to his questions here and here.