Redmine #5721: Fix getgrnam()/getgrgid() failure in NIS/NSS setup.

Following up on fix 3e8b6898fd141919, also for getgrnam/getgrgid.

Also add declaration for AIX5, which has the function, but lacks the
declaration.

(cherry picked from commit 39e76998404b15b1cb4477b5ca500e3956aee486)
Add GetPwEntry() comment to explain why getpwnam is not used.

(cherry picked from commit d1c75819cea297ebef0ab0e8bde52b48e4368666)
Redmine #5819: Fix /etc/shadow extra newline between each entry.

getline() includes the newline in the returned string, so switch to
CfReadLine() instead so we don't get a double newline between entries
when we edit /etc/shadow.

(cherry picked from commit fdeb76530c84ea7f8411ed24fe80b8575669acc7)
Redmine #4241: Depr. INTERRUPTED promise status that was never used.

There was some code for setting classes based on this promise status,
but it was never implemented in the syntax, so it was impossible to
set a class based on it. Since we don't really need to introduce any
more promise outcomes, we alias the INTERRUPTED status to the "failed"
classes attribute.

The actual status is however left intact since it has been available
in reporting.

(cherry picked from commit 5b999726163cbfc38604c5c63f664626c817f7bc)
Redmine #4241: Make sure failed status carries through to the edit end.

Before, we would happily assume that if number of edits were zero,
this would mean that the promise was kept, however it could also be
an error. Fixed by checking the promise status in FinishEditContext().

Note the 017.cf test case, which was testing the inverse condition of
what it claimed to test.

(cherry picked from commit 71ce9974c39a57070f864dc8a67721f62752d5db)
Redmine#4241: acceptance test for missing source template file

(cherry picked from commit dd9dc17fca134e951bf0c4fd5024149cc0d70b29)
Redmine #4241: Fix test after test framework fixes and core fixes.

Note that the file creation is not tested anymore, because the
documentation explicitly says that "create" will be honored first,
whether the file will be edited is a separate step.

(cherry picked from commit d5a4a19a6d663c9aba01609397bd621d60161300)