Generals quit in Poland just days before hard-fought elections