Simplify build_knobs::sample_logical_perms

insert_typed_arg is expanded to optionally negate the argument so we
can use in sample_logical_perms.

Some minor code moved to be slightly more efficient as well.
Optimize build_knobs::sample_logical_perms for feature selection within moses

When the number of feature was large (hundreds) and
build_knobs::_perm_ratio was high (around 1.0) generation of
permutations would explode even with only a feature features
selected. That code only allow to sample from permuations that are
actually permitted.

This code might be slower when the number of feature is
large (hundreds) and no feature selection occurs, but then
representation building is not scalable anyway.

Also, the previous code was sorta wrong when many features were not
permitted because it would sample amongst all features (permitted and
not) and then a probability of getting anything at all would get very
low. Here all the actual number (controlled by
build_knobs::_perm_ratio) of requested permutation is obtained.