FreeTDM: Move I/O interface lookup code into common ftdm_global_get_io_interface()

Auto-loading can be toggled by setting the new autoload parameter
to FTDM_FALSE/FTDM_TRUE.

Update ftdm_span_create() and ftdm_api_execute() to use the new code.

NOTE: Auto-loading of missing I/O interfaces remains enabled in both cases,
      but I guess we should disable it for ftdm_api_execute().

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
FreeTDM: handle_core_command() clean up

Use uint64_t and FTDM_UINT64_FMT for flagval and "%u" for unsigned int.
Extend invalid channel id check to cover chan_id == 0 case.

Use ftdm_strlen_zero() and ftdm_array_len() instead of open-coding them.
Move some variables from global scope into local subcommand scope.

Various other little format string and variable naming fixes.

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>