loopback: Fix crash bug
The loopback message may be called after the sink input is already destroyed which causes a crash. Also memory is leaked because the message object is not correctly freed.
This patch fixes the problems by adding a "dead" flag to the message structure and freeing the message object on exit.