Prison governors have launched a scathing attack on the government, for failing to tackle staff shortages.