Core: redefine c.$headers when building headers for new/replaced header cells. Fixes #683