processes.c : Code cleanup, Bugfix for Solaris and new context switch for Linux

Hello,

Working with patch from icosmin/collectd and from perfwatcher/collectd-pw, I make a new patch on processes.c :

- code cleanup
- support for context switch statistics with Linux
- bugfix for Solaris (checks on malloc)
- factorization of code of Solaris/Linux (similar code : use "#ifdef"s)

Note : this patch also works with 5.1.1 and 5.2.0.

Regards,
Yves