Polish police have detained a man following what was described as a serious threat against the country’s prime minister and defense minister.