Williams probably focused on Sainz ( http://macofan.com/en/index.php?page=ch ... os%20Sainz ) and decided to pit when the gap to him was just big enough to stay ahead after a stop. In addition they may have been afraid of Vettel doing an undercut on them and wanted to be first to undercut.
In the heat of the moment they eventually forgot to look after Ricciardo ( http://macofan.com/en/index.php?page=ch ... 0Ricciardo ) and lost 2 - 2,5 seconds on lap 23.
If you compare Massa's and Vettel's pit stops ( http://macofan.com/en/index.php?page=ch ... n%20Vettel ), you'll see that Massa lost another 7 tenths there, although Massa's pit time is 6 tenths faster!