Fixed a potential error if the request does not contain `params`.

The JSON-RPC 2.0 specs say that the `params` may be omitted. When it is
omitted, we don't want to assign `None` to kwargs by mistake, otherwise
an error will be raised when splatting.

Also slightly improved readability of the code.