Current WeakRef implementation doesn't support to reference to nil and false. The reason for nil is that it can't know whether referenced object is nil or it is garbage-collected and set to nil. The reason for false is that there is an incorrect assumption that referenced objects can't be evaluated to false. By adding a new field to C++ WeakRef class to record whether referenced object is immediate or reference, WeakRef truly supports all kinds of objects.
Fixes a test failure in rspec-mocks.