Prison officers should be armed with lethal weapons to crack down on Islamist terrorists in jail, the shadow justice secretary has said.