res_counter: fix off-by-one bug in setting limit