file_utils: properly report errors (fix #95)