Correctly detect and use the protobuf dependencies

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
client: Fix a few signed-unsigned comparisons

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>