db: handle unchanged return_states better
The situation here is when some paths through the function have
implications for the parameter values and some don't. In other words we
know that a return value of -5 means something about parameter 1 but it
doesn't mean anything about parameter 2.
In that situation the original code would say treat that as an whole_range
but instead we should be looking at the value that we passed into the
function.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>