An Erlang style receive in Prolog