Clean up hit_store to use stat permissions

Change the os.chmod() call to use the stat constants
rather than 0o600, and add a unit test to make sure that
the permissions are being set properly.

Bug: 27718898
Test: `python test_runner.py` passes
Change-Id: Ifea8b99e21f4914b8235733e575d948d5d183b86
2 files changed