agent: Avoid appending a '\0' byte to the response of READKEY