A man with a "large knife" who assaulted two police officers outside Buckingham Palace on Friday night has been arrested, British police said.