persistent_ram: check PERSISTENT_RAM_SIG before writing

if the PERSISTENT_RAM_SIG was corrupted, do not write something
to the persistent_ram buffer. this may cause the abnormal crash.

Change-Id: Ibd3082f7abeaa0e2e4b8f5022360977ec29add6f