With HA, really wait for rabbitmq to be started

Until now, we were just checking that pacemaker has marked the resource
has started. But what we really want is to start making use of rabbitmq,
and it sometimes happen that rabbitmq is still starting while we try to
add the vhost and so on.

So on top of waiting for pacemaker to mark the resource as started, also
wait for "rabbitmqctl status" to tell us that the rabbit application is
really running. This makes the wait more synchronous, like the init
script.

The sed magic comes from
http://unix.stackexchange.com/questions/10226/multiline-pattern-match-using-sed-awk-or-grep/10250#10250

This is also similar to what we do with postgresql, where we try to
connect to it when checking it's running.
(cherry picked from commit 943ca9cb660971924649abb4246069e38c3e2914)