Be more careful when checking for empty files

If we want to avoid reading a totally empty file, it seems better
to check after we have opened the file, not before.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>