BUG: do not consider appeared after a missed ping.

Missed pings are not so uncommon, that's why I use many retries rather than
just one.
This fixes the bug that causes the "appeared" action to be executed after a
succesful ping, right after an unsuccessful one.