Add LOCK_EX to file_put_contents

Add file locking to session file write in order to be sure we write out the data before someone reads again.