Papua New Guinea prime minister quits after weeks of turmoil