Avoid resource warnings when calling pycman.config.init_with_config()

Config files were previously being closed by the garbage collector. Now they
are explicitly closed when the file is popped from the stack, or when the
function raises an exception.