Use exception handler target variable to avoid reference cycle

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

Patch by Martin Panter.
Use subprocess.Popen() over os.popen3() and check GCC exit status

The os.popen3() functions is gone in Python 3.

Before this change it looks like is_keychain_provider_available() would
always indicate success, even if the GCC command failed. Python 2’s
os.popen3() function appears to only return normal file objects, whose
close() methods do not return anything.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

Patch by Martin Panter.
Document dropping of support for python < 2.6.
Remove unnecessary compat code.
Remove unnecessary compat code.