fix get and put packet body length bug
key and value could be Buffer
implement invalid() fix #11