libubus: fix error handling during close after partially receiving a message