Add a function to check if interface exist

It is necessary to check if the interface exist before get info of it.

Signed-off-by: Yanbing Du <ydu@redhat.com>