Fixed typos.
Merge pull request #1700 from nirvdrum/patch-1

Fixed typos.
fix null pointer access with no file pointer

I happen to be working on a system that lacks urandom. While the code does try
to handle this case and artificially create some bytes if the file pointer is
empty, it does try to close it unconditionally, leading to a segfault.
Check key expiration before deleting

Deleting an expired key should return 0, not success.

Fixes #1648
Add test for deleting an expired key

Verify proper expire-before-delete behavior.

This test passes with the expire-before-delete commit and fails
without it.