Avoid static initializer fiasco while collecting rpc hooks.

This fixes the bug in the okws test suite.