Prefer secure_getenv or __secure_getenv to getenv when available

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>