Fix g_clearenv() on BSDs