Move unit deletion to signal

This way the cleanup is separated from other code.

Signed-off-by: Michal Čihař <michal@cihar.com>