1) Are you using some kind of protective case?
2) Does the phone stay in a pant pocket?
It's highly unlikely that it's unlocking without user intervention. I've never heard of or seen anything like that before. You are aware that it will unlock once you've answered a call, right? I assume you're using and talking about screen /keyboard lock here, not (passworded) device lock, correct?
If you could be more specific as to when this happens, and provide some answers to the above, you may get more of a hand here...
Also, I don't get when you say..."it constantly decides to unlock itself randomly, until I pull the battery out,". Are you saying it relocks once the battery is pulled and re-inserted? Only password lock can do that? Is that what you're referring to?
Mine does not unlock on its own. None of my prior BB's did either. If you set it for password lock, you can rest assured nothing will unlock it unless you enter the password.