tool: do not segfault if keyfile doesn't exist, or not enough arguments

It's generally a good idea to check whether argc[2] is not null *before*
using it.
Merge pull request #2 from grawity/sigsegv

tool: do not segfault if keyfile doesn't exist, or not enough arguments