The Australian Prime Minister has replaced his national security and immigration ministers following a debacle regarding incarcerated immigrants.