Police shot dead a man armed with a firearm after he threatened officers north of Brisbane.