BUG: VS11 Debug mode assertions fixes

Commit 04a394ca166aadd38ae7b6642f9617781127caaf increased performance
of array data copying by using std::fill_n instead of for loops.

It seems that in VS2012 Runtime Library, Microsoft decided to check if the
pointer to the first element is null when debug assertions are turned on.

This patch simply checks to see if that pointer is null and if so,
skip the std::fill_n.

Change-Id: I64b3269d305cb81fe95dd9aee163586b341b14f1
Merge topic 'VS2012_debug_assert_fixes'

1fed731 BUG: VS11 Debug mode assertions fixes