Fix keytab file and lock leak when trying all keys