trace: add 'extract' command

Add a 'trace extract' command that hides the gdb magic and is
future-proof when we change the trace transport protocol.

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>