libusbg: Fix issues found with coverity

When pushing the code through scan.coverity.com some issues with buffer underruns and dereferencing after NULL where found. This patch series fixes this.