the rules of football don't apply for Barcelona, so of course it wasn't offside. 

Seriously though, it's obvious that Messi is not going to play that ball and the pass was meant for Pedro not Messi. I think common sense has to be used here and it was by both defense and the refs. The defenders played the posession normally since the ball was being played for someone else.
All of you make good points, but personally I think this is a circumstance where the Messi should be ignored. If he touched the ball or interfered with the keeper it would've been different.