[model] Fix compilation for boost < 1.47

In boost 1.46.1 and less, most of the random stuff were in boost::
namespace directly, and uniform_distribution_int was called uniform_int.
Handle properly < 1.47 and >= 1.47 case with preprocessor.

While here, fix off by one in access to name[N] (-Warray-bounds).