loffice: handle in/out filenames and stdin/stdout properly