keystore: Add paddings before checksumming.

Also fix a file descriptor leak when file system is nearly full.

Bug: 2339184
1 file changed