Fixed bugs in LibcWrapGenerator.vala

The generator was working on my system but still had some flaws I didn't
encounter, thanks to Thiblault Saunier for testing this and finding it's
weakness on his system I was able to fix this.