crtbegin: accurately check for the end of .dtors
(cherry picked from commit 6ee34bca48a9e0867d46b24a78855e225d46ddda)