German submarine-hunting planes are to be based in Britain for the first time, to counter the threat from Russia.