Add more tests of supervisor

Add tests of code_change/3 and error handling of supervisor flags.
Rebase supervisor

Remove duplicated code related to checking of supervisor flags.
[sasl] Remove undocumented upgrade instruction

The upgrade instruction 'remove_module' was added in OTP R7B (and
possibly in a patch in R5B or R6B, ticket OTP-3477), and translates to
the low level instruction 'remove', but adds the parameter DepMods
(modules on which Mod is dependent). The ticket says that
"remove_module should be added for symmetry with the add_module
instruction". remove_module was never documented or tested, and it was
never mentioned in a release note. It therefore seems to be low risk
in removing it.

The correct instruction to use when removing a module is

{delete_module,Mod}

which was added in OTP R10B and which is also documented and
tested. This translates to low level instructions 'remove' and 'purge'
i.e. the module is brutally purged after setting the current code to
old. This hardcoded brutal purge is the reason why PrePurge and
PostPurge parameters can not be given with the delete_module
instruction.

The parameter DepMods which was inclued in the remove_module
instruction does not exist for delete_module. From the documentation's
point of view, this is the same for add_module, and thus the two
instructions {add_module,Mod} and {delete_module,Mod} are now
symmetric. However, in the code there is a second instruction for
adding a module, {add_module,Mod,DepMods}, which is not documented. To
add symmetry even for this, {delete_module,Mod,DepMods} is now also
added. Documentation is added for all instructions.
Allow maps for supervisor flags and child specs

Earlier, supervisor flags and child specs were given as tuples. While
this is kept for backwards compatibility, it is now also allowed to
give these parameters as maps:

-type sup_flags() :: #{strategy => strategy(),         % optional
		       intensity => non_neg_integer(), % optional
		       period => pos_integer()}        % optional

-type child_spec() :: #{id => child_id(),       % mandatory
			start => mfargs(),      % mandatory
			restart => restart(),   % optional
			shutdown => shutdown(), % optional
			type => worker(),       % optional
			modules => modules()}   % optional

Default values are as follows:

Supervisor flags:

strategy: one_for_one
intensity: 1
period: 5

Child specs:

restart: permanent
type: worker
shutdown: 5000 for workers, 'infinity' for supervisors
modules: [M], where M comes from the child's start {M,F,A}

Some of these default values are quite hard to decide on, since there
really is no "most common way". It always depends on the use case. So
we decided that the most important reason for having default values is
to lower the start barrier and get "something" running. For production
use, most systems must be fine tuned in this respect anyway.

This is how we reasoned about it:

Strategy: just pick one - and 'one_for_one' was most used in OTP.

Max restart frequency (intensity/period): by allowing one restart only
we keep the important supervisor feature of restarting children, but
we also avoid the possibility of scaling to a huge amount of restarts
if the supervisor tree is deep.

Restart: just pick one - and 'permanent' is fairly common.

Shutdown for workers: to avoid the confusion of why the terminate
function is not executed, we decided not to use 'brutal_kill'. Which
number to use is probably not that important, so we chose 5000.

Shutdown for supervisors: the recommended shutdown value for
supervisors is 'infinity', so we decied to use that. Having the same
(integer) value as for workers can give very strange results.

Type: just pick one - and we believe that 'worker' is most common
New function supervisor:get_childspec/2

Takes the name of the child (or Pid, in the case of a
simple_one_for_one supervisor) and returns the map which specifies the
child.
Expose NIF version

This patch allows checking for NIF API version in a way similar to
driver version. E.g. by calling erlang:system_info(nif_version).

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Section reference number incorrect
Add test of maps in supervisor flags and child specs
Add documentation of maps in supervisor flags and child specs
Update dialyzer test with maps in supervisor properties

After introducing maps for supervisor flags and child specs two tests
in behaviour_SUITE started failing:

behaviour_SUITE:custom_sup - failed because the type of the Period
(MaxT) property had been changed (corrected) from non_neg_integer() to
pos_integer() in the specification of the init callback in
supervisor.erl

behaviour_SUITE:supervisor_incorrect_return - same as above, plus the
introduction of #{} as possible value for the supervisor flags and
child_specs.
Update emacs skeleton for supervisor to use maps

The example in the skeleton now uses maps instead of the old tuple
format for supservisor flags and child specifications.
Merge branch 'siri/sup-spec-maps/OTP-11043'

* siri/sup-spec-maps/OTP-11043:
  Update emacs skeleton for supervisor to use maps
  Update dialyzer test with maps in supervisor properties
  Add documentation of maps in supervisor flags and child specs
  Add test of maps in supervisor flags and child specs
  New function supervisor:get_childspec/2
  Allow maps for supervisor flags and child specs
  Rebase supervisor
  Add more tests of supervisor
Merge branch 'siri/sasl/delete_module/OTP-11540'

* siri/sasl/delete_module/OTP-11540:
  [sasl] Remove undocumented upgrade instruction
Merge branch 'jmrepetti/maint' into maint

* jmrepetti/maint:
  Section reference number incorrect
Merge branch 'maint'
Merge branch 'lemenkov/expose_nif_version' into maint

OTP-12298

* lemenkov/expose_nif_version:
  Expose NIF version
Merge branch 'maint'