Refactor: tools: Functionize getting shadow instance from env
...in crm_shadow. This is for better code isolation and begins a cleanup
of the monolithic main() function.
We could make GError global (since exit_code already is), but the GError
rules say:
"The last argument of a function that returns an error should be a
location where a GError can be placed (i.e. GError **error)"
Source:
https://docs.gtk.org/glib/error-reporting.html#rules-for-use-of-gerror
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>