affile: affile_open_file() refactored

Small, [more] readable private functions created around affile_open_file().

Signed-off-by: Budai Laszlo <lbudai@balabit.hu>