Merge pull request #484 from nomis52/master

Factor out the C++ RPC server code into it's own class.
Merge pull request #485 from nomis52/master

Fix buildbot
Merge pull request #486 from nomis52/master

Fix a build failure and a comment.
Execute the remaining callbacks during SelectServer shutdown.

Previously we just deleted the callbacks without running them, but this means
that callbacks which themselves free memory aren't run, and we leak in some
test cases. Some tests work around this with a final call to ss->RunOnce() but
that's lame.

Also this improves the normal code path by taking the lock once, rather than
once for every callback queued.
Update the Execute() documentation to reflect the new guarentee.