shared/shell: Don't allocate any data if env value is NULL

If value is NULL there is no point in allocating any data if value is
NULL since bt_shell_get_env would return NULL anyway, also this makes
sure the existing value is freed which means passing NULL can remove
an env like it was intended.
1 file changed