Test the return value of fgets/fscanf calls

Fix a few fgets/fscanf calls which do not test the return value and
cause gcc warnings.

Patch provided by Ivana Varekova.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>