Crosslinking of polyamines by phosgenation