main ipc_activity: misc improvements
Stop IPC after getting an error. One point is the situation when one of the forks ends for some reason, which lead to problems. Another point is pipes getting out of sync.
Smaller changes:
- don't free the handle while it's still half-in-use
- don't fully panic here because of ENOMEM, just stop IPC
Fixes #150 (closed)