A man is believed to have thrown shotgun cartridges into the grounds of Buckingham Palace, leading to his arrest and officers conducting a controlled explosion, police say.