A curling free-kick in added time from Morten Gamst-Pedersen earned Blackburn a 2-2 draw with Rochdale at Spotland after falling two behind.