I have tried setting the energy saver setting sleep to never. I tried both Caffeine and NoSleep apps. I've tried setting pmset sleep to 0. I read somewhere that it might be the lid sensor which is on the ribbon cable for the battery light indicator, so I disconnected it but it would still go to sleep. I've also tried resetting the SMC, and it made no difference. Not sure what is wrong. I'm running 10.9.3 on a Macbook Pro mid 2009.
Update: http://pastebin.com/7Q3aVZam Power Management logs