libusbg: Fix readlink/buffer overrun issue. CID#56130, CID#56129

Readlink can return the total length of the buffer (here 4096), so we do not
want to dereference target[4096] as that would give an off by one error.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
libusbg: Fix buffer overrun issue. CID#56128

Avoid calling usbg_read_string with a 40 byte long buffer, which in turn is filled in
by usbg_read_buf which uses a maximum of USBG_MAX_LENGTH which is 256 bytes.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
libusbg: Do not try to dereference func when it is NULL. CID#56127

We check if func is NULL, so if the allocation function failed we should
not dereference or handle it anymore, so we jump straight to the end.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>