lib: avoid use of obsolete getpass() function

Reference: http://man7.org/linux/man-pages/man3/getpass.3.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lib: add function to remove string from memory

The memcpy(3) can be get optimized out by compiler.

Reference: https://www.securecoding.cert.org/confluence/display/seccode/MSC06-C.+Beware+of+compiler+optimizations
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
newgrp: use xgetpass() and memset_s() to group password validation

Signed-off-by: Sami Kerola <kerolasa@iki.fi>