Fix _strip_content_frames_out_of_stack for Python 2.