New Zealand were bowled out for 45, the equal 12th lowest total in Test history, on the opening morning against South Africa at Newlands.