The life of a Sri Lankan maid due to be stoned to death in Saudi Arabia for adultery has been spared, Sri Lanka's foreign ministry says.