syscalls: Fix all incorrect getdtablesize() usages

The maximal number of open files per process may be larger than the size
of fdset. In this case all these testcases has been failing randomly.

Fix them by actually counting the maximal value for the open file
descriptor.

NOTE: This is only a quick fix, we should probably move the code to a
      library because the do_child() function is nearly the same in
      all the cases.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>