Fix memory alloc for key_entry add/remove

Add KEY_ERROR case to add and remove functions
Merge branch 'rfc6810-bis' of github.com:rtrlib/rtrlib into rfc6810-bis