Groonga::Context#restore supports block

If a block is given, command response is yielded. It yields a sent
command and its response.