service: Helper for sending generic RPC errors

We'll need such further.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pre-dump: Enforce track-mem and leave-running in cr_pre_dump_tasks

Service will call the pre-dump routine, so this is factoring out
enforcin options for CLI and RPC.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
daemon: Write own daemon routine

RPC will start page-server daemon and needs to get the
controll back to report back to caller, but the glibc's
daemon() does exit() in parent context preventing it.

Thus -- introduce own daemonizing routine.

Strictly speaking, this is not pure daemon() clone, as the
parent process has to exit himself. But this is OK for now.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
page-server: Start using new cr_daemon routine

After this the called of cr_page_server gets controll
back with the server's pid.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
rpc: Add more stuff to RPC messages

This includes pre-dump and page-server actions and
arguments for memory tracking and page-server.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
rpc: Introduce CLI's --action-script analogue

Service shouldn't call client provided scripts, as it
creates a security issue (client may be unpriviledged,
while the service is).

In order to let caller do what it would normally do with
criu-scripts, make criu notify it about scripts. Caller
then do whatever it needs and responds back.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
service: Start page-server request implementation

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
service: Implement pre-dump request support

This works as multi-req thing -- caller issues the
pre-dump request, criu serves it and sends result back.
Then service waits for the next request on the same
session, client doesn't have to re-connect back.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>