(#19056) strip trailing space while parsing AIX password file

Copied out of the redmine ticket, with the addition of a comment.

I know next to nothing about AIX, so writing tests for this could be tricky :/