MOAR cleanups.
Merge pull request #9711 from vipulnsward/moar_cleanups

MOAR cleanups of unused variables.
 #7347: Destroy marked child records before new child records inserted