fd: effectively revert r305091
Turns out fd_lastfile can survive being -1 for some processes, giving incorrect results with the cast.
Noted by: cem