An Australian cruise ship was detained by maritime safety officials after running aground in Papua New Guinea.