parse_keyfile_line: fix possible invalid read

Change-Id: I79bbb3dec44a7566a99ec6ae15a1775ca8723a0c