I believe it is political suicide to dump any leader when in power.
the best a party could do is a mandatory leadership vote three months before the earliest election date.
then it may be seen as a deliberate change and any resigning leader will have some time to hand over the ropes.
the only thing that allowed Gillards and Turnbull to scrape in was it was during their parties first term in office. The electorate has very rarely kicked out a party after one term.