Implement "getchains" RPC command to monitor blockchain forks.

Port over https://github.com/chronokings/huntercoin/pull/19 from
Huntercoin:  This implements a new RPC command "getchains" that can be
used to find all currently active chain heads.  This is similar to the
-printblocktree startup option, but it can be used without restarting
just via the RPC interface on a running daemon.
Rename proposed RPC call to "getchaintips".

Rename the proposed RPC call "getchains" to "getchaintips", as suggested
in the Github pull-request discussion.
Clean up getchaintips RPC call.

Clean up the code for "getchaintips" and extend the help string, in
accordance with discussion in the Github pull request.
Add RPC test script for "getchaintips".
Remove redundant lock in getchaintips.