Western Australia’s parliament has passed the first major changes to the state's abortion laws in a quarter of a century.