cleanup: remove all dead assignments

As pointed out by clang-analyzer.
linux: return early if we have no interfaces

This was pointed out as possible undefined allocation of 0 bytes by
clang-analyzer. `malloc` of 0 bytes can return either `NULL` or a
valid pointer which can't be dereferenced. On systems which return
`NULL`, we would consider it a `malloc` error and return an `ENOMEM` to
the caller.
cleanup: remove a dead increment

As pointed out by clang-analyzer.