The given sentences a an b are both clearly valid and acceptable. I would argue that sentence a would be clearer and better if rephrased as one of :
- a1. He had a knife in his pocket to defend himself with.
- a2. He had a knife in his pocket with which to defend himself.
a1 and a2 make it clearer that "to defend himself" is a non-restrictive relative clause. It describes the purpose of the knife.
A similar change could be made to sentence b, giving:
- b1. In his pocket, he had a knife to defend himself with.
- b2. In his pocket, he had a knife with which to defend himself.
Here I think the change is less important, because the subordinate clause "to defend himself" directly follows "knife", already making it clearer what that clause applies to.
Sentence c, as the question suggests, is potentially ambiguous. It also requires a bit more thought to correctly sort out the intended meaning. Nor does the possible addition of "with" or "with which" help this. It is not grammatically incorrect, but there is no benefit that I can see to balance these problems, so I would think it poorer writing, unless the context somehow made it important or useful to use this form.