As for what to do if the player makes the character act "out of character", my answer is nothing. Once you allow that character as a PC, you are putting that character's actions in the hands of your player. And like I said before, both of you have to abandon what you think you know.
You think you know what Yoda or James Bond or Harry Potter will do in a given situation. But you've already given responsibility for those decisions to a player. Like I said, if the player can't change the story, why are you bothering?
And more than that, in the social compact of RPGs, the PCs actions are the purview of the player, not the GM. A deal was made, implicitly or explicitly. The player said, one way or another, "I want to take over this well-known character and make his choices for him." You said, "OK. Go ahead." You can't go back on the deal now just because you don't like the choices.
What you can do is react within the fiction. In the Harry Potter example above, what happens to Harry next? A trip to Azkaban, I'll bet! That's what they do with murderers! So while you can't prevent an out-of-character action, you can react to one in a way that is consistent with the fiction you're creating. Even if Harry gets imprisoned, there's still a lot of room for roleplaying adventure here! He gets a trial right? People escape from Azkaban, right? Can he convince Ron and Hermione that he was forced to do what he did? What happens to wizarding society if "Voldemort was on his head, so I had to kill him!" becomes a valid defense?
If you're going to let a player take an existing character, you've got to let him take it. You can't put him on a track and never let him deviate. You've got to roll with the changes wrought by the player - and existing characters are frequently powerful people in critical positions, able to make vast, sweeping changes to their worlds. That's what makes them interesting in the first place! But the player has to accept the consequences of his out-of-character actions - after all, he's the one who wanted to shake things up!