shadow: Move spent parsing to internal function
shadow: Implement sgetspent
getopt_long: Support abbreviated option matching

From the getopt_long manpage:

    Long option names may be abbreviated if the abbreviation is unique
    or is an exact match for some defined option
strcmp: Remove unnecessary check for *r

If *l == *r && *l, then by transitivity, *r.
putgrent: Stop writing output on first failure

This way, if an fprintf fails, we get an incomplete group entry rather
than a corrupted one.
putgrent: Add missing newline
shadow: Implement putspent
Add logwtmp stub