bitbake/utils: Improve environment handling to allow UIs access to original environment

We need to empty out the environment whilst we build the cooker but
we need the environment for the UIs since hob uses DISPLAY and other
session variables.

This patch adapts the utils functions to return removed environment
components so we can reinject them for use by the UI, allowing hob
to work again.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>