hmp: fix sendkey out of bounds write (CVE-2015-8619)