rpcserver: add helper functions to format open and closed RPC channels.
rpcserver: add helper functions to format open and closed RPC channels.

`createRPCChannel` is used by the `listchannels` RPC call and will be
used by `subscribechannels` as well.
`createRPCClosedChannel` is used by the `closedchannels` RPC call and
will also be used by `subscribechannels`.

This is used by the `listchannels` RPC call and will be used by
`subscribechannels` as well. Its purpose is to mitigate code duplication
between the two RPC calls.

LightningNetwork/lnd,aakselrod/lnd,aakselrod/lnd,LightningNetwork/lnd