Attempt to clean up actions when terminating a slave. Slave termination now never deletes a queue.
Remove use of gm:leave/1: it does almost nothing, master does not invoke it, and it's racy anyway.
Merged bug25618 into stable