Hi
its quite possible that you're activating your screen and also, shutting it down while in your pocket. if you're sitting, and the pants hold it tight enough, it could activate the power off prompt, and your leg can actually be selecting the power off option. If it does not occur outside of your pocket, then I think you found your answer. There is nothing that can be done to change this, other than making sure you wear loose fitting clothing, or a belt clip case of sort.
Chris