Papua New Guinea has said it will close a refugee detention centre after the island nation's Supreme Court ruled that Australia's detention of asylum seekers there was illegal.