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.