Update lock_files.py

Read and write the files are binary.