introduce common syscall wrappers, and use them

We had an 'eSocketBase' class which contained several
useful wrappers, make them global so everyone can use them.