Ring Buffer: Modified the overloaded subscript operator.

Fixed compilation errors and warnings. The subscript operator has to
return a value that is already somewhere in memory. It was impossible
to return NULL as an error code.