A fatal stabbing at a primary school near Warsaw and a machete attack a day earlier have prompted nationwide security measures.