Add simple BSD socket layer to make picoos-net programs
compatible with other network stacks.
Code cleanup.