Voluntary dying bill wins NSW vote