General: typedef some structures for less-typing

Also update their respective examples.

This includes:
socket, module, stack, polling, tasks.
Minor changes

Mostly documentation.
socket: Remove asserations from free_conn()

This fixes a bug when compiling in release mode since assert
is not supposed to execute the function called on release mode.