Add LOCK_EX to file_put_contents

This will create an exclusive file lock when writing the file data, ensuring no other process reads the session file while we are writing it. This is inline with PHP's native session handler which locks on file write. It may lock on file read as well, investigating that, but this is a good place to start.