Random build warning fixes (implicit declarations etc)

Fix a number of gcc warnings during build.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>