Fix race condition on cog server shutdown

Some recent change is causing some unit tests to fail; they are crashing
in the cogserver destructor.  The root cause is that the cogserver global
is NULL when the cogserver destructor runs, resulting in a null pointer
deref.  This changeset boils the ocean to fix this.  Anyway, globals are
evil, so this is a worthy change, never mind the original bug.
fix build break for unit tests

Last set of changes broke one unit test.
server Requests and Agents belong to the server

Requests and Agents cannot live in a vacuum; they are a part of a server.
This fixes continuing problems with crashes in test cases when a server
is destructed (there's essentially a race between destruction and server
access).  Unfortunately, the fix required boiling the ocean.
iBuild break fixes from last commit

The last commit broke some of the tests. Fix them.
Merge pull request #270 from linas/crash-fix

Crash fix