Make test__refcount_core pass; also detach old socket on __init__ with given _sock for PY3