The UK government feared they would be sued by Andrew Mountbatten-Windsor if made to face questioning, documents reveal.