The Australian and Papua New Guinea governments have agreed to end a regional resettlement arrangement four years after the closure of Manus Island.