This patch moves the old definition checking logic introduced by
f4b7be3f8430 earlier. So that the test itself does not depend on aliasdef.
The check is to avoid wrapping a same alias multiple times. It can be done
by checking the config name and value (definition in code), without
constructing a cmdalias instance.
This makes the next patch easier to review.