shadownaemon: make sure command files are cleaned

sometimes command files are not removed properly. Delete
them after they should have been processed to avoid processing
them over and over.
shadownaemon: close sockets when connect fails

this closes a ressource leak on unavailable remote sites.