Loop in cached attachment recreation

Fixes the issue of cached attachment recreation in the case where the main part body has changed on reparse.