[test_server] Add test_server_io:print_unexpected/1

To use from any process to print a string in the unexpected_io.log.
[common_test] Send unexpected logging to test_server's unexpected_io.log

If it could not be decided which test case a certain log printout
belonged to, the common test framework log was earlier used. Such
printouts are now instead sent to unexpected_io.log in test_server so
that there is only one place to look for "missing" printouts.
[common_test] Add test for unexpected I/O
Implement add_report_sup_handler in error_logger

Adds a new event handler to the error_logger in the same
way as add_report_handler/1,2 but will also supervise the
connection between the event handler and the calling process.
Use a set to store ref registers in beam_receive

In some circumstances, as when inlining code, when some optimization
passes are disabled or with hand-written but semantically correct Core
Erlang or BEAM assembly, a fresh reference may be live in more than one
register:

    ...
    {allocate_zero,2,2}.
    ...
    {call_ext,0,{extfunc,erlang,make_ref,0}}. % Ref in [x0]
    ...
    {move,{x,0},{y,0}}. % Ref in [x0,y0]
    {move,{y,1},{x,0}}. % Ref in [y0]
    ...
    {move,{y,0},{x,0}}. % Ref in [x0,y0]
    {move,{x,0},{y,1}}. % Ref in [x0,y0,y1]
  {label,5}.
    {loop_rec,{f,6},{x,0}}. % Ref in [y0,y1]
    ...
    {loop_rec_end,{f,5}}.
  {label,6}.
    {wait,{f,5}}.
    ...

Pass beam_receive expects a single live register for the ref when it
encounters the loop_rec instruction and crashes with the following
reason:

$ erlc t.S
...
crash reason: {{case_clause,
                   {'EXIT',
                       {{case_clause,[{y,1},{y,0}]},
                        [{beam_receive,opt_recv,5,
                             [{file,"beam_receive.erl"},{line,154}]},
                         ...]}}},
               ...}

This commit teaches beam_receive how to use a set of registers instead
of a single one when tracking fresh references, thus avoiding the crash.
Move let expressions into sequences

The Core Erlang compiler simplifies let expressions by moving them
into their argument when it is another let or a case expression.
It can then perform other optimizations such as removing the let
expressions altogether, sometimes saving BEAM registers later in
the process.

This commit teaches sys_core_fold how to move let expressions into
sequence arguments.
Merge branch 'siri/common_test/unexpected_io/OTP-10494' into maint

* siri/common_test/unexpected_io/OTP-10494:
  [common_test] Add test for unexpected I/O
  [common_test] Send unexpected logging to test_server's unexpected_io.log
  [test_server] Add test_server_io:print_unexpected/1
Merge branch 'dg/win_icon' into pu
Merge branch 'rc/break-out-asserts' into pu
Merge branch 'jaf/fix-supervisor-multi-restart' into pu
Merge branch 'nox/file-receive-optim' into pu
Merge branch 'lh/demonitor-flush' into pu
Merge branch 'nox/move-let-into-seq' into pu
Merge branch 'nox/fix-multiple-ref-regs' into pu
Merge branch 'pn/error-logger-sup_handler' into pu