compat: Add implementation of getline from gnulib.