Well. I still wasn't satisfied with my answers so I investigated further.
The problem is in this line
void shooting_set_focus(int v, short is_now)
{
...
if (!conf.dof_use_exif_subj_dist)
s+=shooting_get_lens_to_focal_plane_width();
lens_set_focus_pos(s);
...
}
but the thing is that shooting_get_lens_to_focal_plane_width() returns the distance between the end of the lens and the sensor.
So if I pass 0xFFFFFFFF to shooting_set_focus(0xffffffff,is_now) it will always add 49 (in my case without zoom).
So the acual value that gets passed to lens_set_focus_pos(s) is 0xffffffff+49 which then sets the focus to 48 and not infinity like it should.
A simple fix would be
if (!conf.dof_use_exif_subj_dist && (s != INFINITY_DIST))
I guess this issue should be noticeable on all cameras.