A stable numerical framework for long-time dynamic crack analysis