Fix remote diameter_request table leak

An outgoing request whose pick_peer callback selected a transport on
another node resulted in an orphaned diameter_request entry on that
node.
Honor bind_to for manager net_if family inet

Bug reported by Pavel Baturko to erlang-bugs.
Try to increase test case timeouts
Fix handling of 3xxx Result-Code without E-bit

Commit 00584303 broke the population of the errors field of the
diameter_packet record when an incoming request with an
E-bit/Result-Code mismatch was decoded. Instead of the intended

  {5004, #diameter_avp{value = integer()}},

the value was a 4-tuple containing the integer Result-Code.
Rename reconnect_timer to connect_timer in examples and suites

The timer was renamed in commit abea7186.
Check {connect,watchdog}_timer distinction in event testcases

The connect timer is currently ignored by a connecting transport,
so the check causes one testcase to fail.
Fix ignored connect timer

There are two timers governing the establishment of peer connections:
connect_timer and watchdog_timer. The former is the RFC 6733 Tc timer
and is used by diameter_service to establish an initial connection. The
latter is RFC 3539 TwInit and is used by diameter_watchdog for
connection reestablishment after the watchdog leaves state INITIAL. A
connecting transport ignored the connect timer since the watchdog
process never died, regardless of the watchdog state, causing the
watchdog timer to handle reconnection.

This seems to have been broken for some time.
Tweak reason in closed event

From {error, Reason} to {no_connection, Reason} when a connection can't
be established. The exit reason of a diameter_peer_fsm process is turned
into a message from the corresponding diameter_watchdog process to the
relevant diameter_service process, the latter sending a 'closed' event
including the reason to any subscribers. Reason = [] when none of the
configured transport modules succeeds in establishing a connection,
which admittedly isn't terribly descriptive. (The lists is of error
reasons from transport start functions, which is empty as long as
transport processes start successfully.)

Note that this form of the closed event is undocumented, aside from the
documentation saying that one should expect undocumented events. The
explicitly documented forms are currently specific to CER/CEA failures.
Merge branch 'maint' of git-server:otp into maint
Add spec for gen_server:terminate/6,7

This is to prevent dialyzer warning "no local return".
ssh: Gracefully handle bad input
Sort keys before generating

This has to be done in order to consistently generate the same
file so that we do not get rebuilds all the time.
Clean up temporary dtrace file during config

When configuring erts to support dynamic trace via dtrace, be sure to clean
up the temporary file "erts/foo-dtrace.h" used to help check for dtrace
support. Otherwise, it shows up as an untracked file in git.
Introduce os:getenv/2

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Order peers in pick_peer callbacks

The order of peers presented to a diameter_app(3) pick_peer callback has
previously not been documented, but there are use cases that are
simplified by an ordering. For example, consider preferring a direct
connection to a specified Destination-Host/Realm to any host in the
realm. The implementation previously treated this as a special case by
placing matching hosts at the head of the peers list, but the
documentation made no guarantees. Now present peers in match-order, so
that the desired sorting is the result of the following filter.

  {any, [{all, [host, realm]}, realm]}

The implementation is not backwards compatible in the sense that a realm
filter alone is no longer equivalent in this case. However, as stated,
the documentation never made any guarantees regarding the sorting.
Merge branch 'siri/gen_server/try-catch/OTP-12263' into maint

* siri/gen_server/try-catch/OTP-12263:
  Add spec for gen_server:terminate/6,7
eldap: Fix timeout missing in ssl:connect
Merge branch 'maint'
Merge branch 'hans/eldap/timout_connect/OTP-12311' into maint

* hans/eldap/timout_connect/OTP-12311:
  eldap: Fix timeout missing in ssl:connect
Merge branch 'maint'

* maint:
  eldap: Fix timeout missing in ssl:connect