fix for reshape2:::dcast segfault

Note: I dint write any of this code. split-numerics.cpp was written by Hadley and I took the changes for RcppExports from Romain's code in dplyr.

This should fix the segfault in dcast: https://github.com/hadley/reshape/issues/31