Pakistan foils plot to assassinate prime minister