libusbg: Add checking for legal function type.
libusbg: Add checking for legal function type.

Function type provided by user to functions should
be checked before usage to avoid errors.

Signed-off-by: Krzysztof Opasiak <8064eda6f94b3817252b7d7649cf754592f63500@samsung.com>

pszewczyk/libusbg,pszewczyk/libusbg