A former prime minister of Finland has secured a court order banning a man who rang her doorbell in December from making contact with her.