From my archives, I found this:
===========================
First, disable hibernation mode :
sudo pmset -a hibernatemode 0
delete /private/var/vm/sleepimage :
sudo rm /private/var/vm/sleepimage
create an empty file and name it 'sleepimage' :
sudo touch /private/var/vm/sleepimage
change this flag to immuable:
sudo chflags uchg /private/var/vm/sleepimage
Now, OS X won't be able to rebuilt over your sleepimage file since it is locked.