Issue #21119: asyncio now closes sockets on errors

Fix ResourceWarning: create_connection(), create_datagram_endpoint() and
create_unix_server() methods of event loop now close the newly created socket
on error.
Issue #21119: asyncio: Make sure that socketpair() close sockets on error

Close the listening socket if sock.bind() raises an exception.
Merge 3.4: Issue #21119, fix ResourceWarning in asyncio

* Make sure that socketpair() close sockets on error. Close the listening
  socket if sock.bind() raises an exception.
* asyncio now closes sockets on errors. Fix ResourceWarning:
  create_connection(), create_datagram_endpoint() and create_unix_server()
  methods of event loop now close the newly created socket on error.
cleanup test_asyncio/test_base_events.py: cm variable was unused
(Merge 3.4) cleanup test_asyncio/test_base_events.py: cm variable was unused
Issue #21651: Fix ResourceWarning when running asyncio tests on Windows.
Patch written by Claudiu Popa.
(Merge 3.4) Issue #21651: Fix ResourceWarning when running asyncio tests on
Windows. Patch written by Claudiu Popa.
Fix asyncio tests on Windows: wait for the subprocess exit

Before, regrtest failed to remove the temporary test directory because the
process was still running in this directory.
(Merge 3.4) Fix asyncio tests on Windows: wait for the subprocess exit

Before, regrtest failed to remove the temporary test directory because the
process was still running in this directory.
Issue #21326: Add asyncio.BaseEventLoop.is_closed() method

Add BaseEventLoop._closed attribute and use it to check if the event loop was
closed or not, instead of checking different attributes in each subclass of
BaseEventLoop.

run_forever() and run_until_complete() now raises a RuntimeError('Event loop is
closed') exception if the event loop was closed.

BaseProactorEventLoop.close() now also cancels "accept futures".
Issue #18409: Idle: add unittest for AutoComplete. Patch by Phil Webster.
Merge with 3.4
Don't chmod() if path is a symlink.
Don't chmod() if path is a symlink.
Replace deprecated time.clock() with time.time(). Fixes issue #20475.
Issue #18292: Idle - test AutoExpand. Patch by Saihadhav Heblikar.
merge from 3.4
Merge heads.
Merge heads.
Merge with 3.4