some bugfixes

- fixing pid file handling
- mbuffer network mode only if sending to remote host
- test case for network mode