Poland's ban on abortion is close to collapse, after mass protests put pressure on politicians to vote against it.