Spain reveals 609,000 undocumented migrants have been given work permits as their application for legal status is processed under socialist PM’s plan