emit message when command response is ready

Signed-off-by: Tomas Neme <lacrymology@gmail.com>
emit connection-related events

Signed-off-by: Tomas Neme <lacrymology@gmail.com>
clean up pending commands list as well

Signed-off-by: Tomas Neme <lacrymology@gmail.com>