Avoid calling std::copy when the number of items to copy is 0

Fixes test failures due to crashes in Debug builds using VS 2010.
Should fix the majority of failing tests on the Debug mirkwood dashboard.

Change-Id: I22154849328802f6073e2e9125d0ca75c5d1242a
Merge topic 'fix-dashboard-test-failures' into master

4aeec366 Avoid calling std::copy when the number of items to copy is 0