obshash: properly cache obshash value
The code was buggy and only cached non-nullid/non-inherited value. This was
previous hidden because we were using a 'propertycache' to cache the value on
the range object. This fixes it and restore a lot of performance.