John Swinney has said Donald Trump's second state visit to the UK should not take place if the US withdraws its support for Ukraine.