cmd: Infer handle type from handle value in WCMD_fgets and WCMD_ReadAndParseLine.