Fix concurrency issues in SockJS session impls

Cherry-picked from:
https://github.com/spring-projects/spring-framework/commit/fcf6ae83285890f2e8e7de77dcc6e633129978e8

Issue: SPR-11916
Add support for setting removeOnCancelPolicy

This change introduces removeOnCancelPolicy on ThreadPoolTaskScheduler
and ScheduledExecutorFactoryBean and sets it to true for SockJS.
This ensures that cancelled tasks are removed immediately to avoid
the "unbounded retention of cancelled tasks" that is mentioned in
the Javadoc ScheduledThreadPoolExecutor:

"By default, such a cancelled task is not automatically removed from
the work queue until its delay elapses. While this enables further
inspection and monitoring, it may also cause unbounded retention of
cancelled tasks. To avoid this, set setRemoveOnCancelPolicy to true,
which causes tasks to be immediately removed from the work queue at
time of cancellation."

This is a backport for:
https://github.com/spring-projects/spring-framework/commit/7441f2301281049cff7224bf650646490388080e

Issue: SPR-11918
Add check for unused WebSocket sessions

Sessions connected to a STOMP endpoint are expected to receive some
client messages. Having received none after successfully connecting
could be an indication of proxy or network issue. This change adds
periodic checks to see if we have not received any messages on a
session which is an indication the session isn't going anywhere
most likely due to a proxy issue (or unreliable network) and close
those sessions.

This is a backport for commit:
https://github.com/spring-projects/spring-framework/commit/a3fa9c979777e554efad0df429041767f05dfdb8

Issue: SPR-11884
Avoid multiple invocations of afterConnectionClosed

This change ensures the state of a SockJS session is set to CLOSED
immediately after close is invoked. This avoids duplicate invocations
of afterConnectionClosed in WebSocket transport.

This is a backport of:
https://github.com/spring-projects/spring-framework/commit/3af488a701834f61b89cd84040605a6252962e9c

Issue: SPR-11884
Minor fix in STOMP broker relay

This is a backport for a change made as part of:
https://github.com/spring-projects/spring-framework/commit/113fd1180a14656a89d6d6639d259c577d70fbc5

Issue: SPR-11884