Israel’s top general resigns, citing failure to prevent Hamas attack that ignited war in Gaza