keyfile: return 0 when the parsed double value is invalid