Fix some Dialyzer warnings

Dialyzer recognizes a certain pattern that makes it possible to get
rid of 'The created fun has no local return' warnings.
Correct the contract of io:getopts()
test_server: Fix a Dialyzer warning
Merge branch 'hb/spec_related_fixes'

* hb/spec_related_fixes:
  test_server: Fix a Dialyzer warning
  Correct the contract of io:getopts()
  Fix some Dialyzer warnings
Return warnings for unknown types and functions in Erlang Mode

The warnings about unknown types and functions are now returned
when calling Dialyzer from Erlang, in particular from an escript.

When calling Dialyzer from the command line the warnings about unknown
types and functions are output last as before; and when using the GUI
the warnings are displayed in a pop-up window, as before.
Introduce a new warning option, 'no_unknown'

Not (yet) documented.
Merge branch 'vinoski/ds-enif-send'

* vinoski/ds-enif-send:
  enable enif_send to work from a dirty scheduler
Merge branch 'hb/dialyzer/unknown_warnings'

* hb/dialyzer/unknown_warnings:
  Introduce a new warning option, 'no_unknown'
  Return warnings for unknown types and functions in Erlang Mode
Bump versions and ensure that all are "normal" versions

Ensure all are "normal" versions according to the new version scheme
introduced in OTP 17.0
Introduce runtime_dependencies in .app files

Most dependencies introduced are exactly the dependencies to other
applications found by xref. That is, there might be real dependencies
missing. There might also be pure debug dependencies listed that
probably should be removed. Each application has to be manually
inspected in order to ensure that all real dependencies are listed.

All dependencies introduced are to application versions used in
OTP 17.0. This since the previously used version scheme wasn't
designed for this, and in order to minimize the work of introducing
the dependencies.
Add test-case verifying runtime dependencies found by xref
Verify runtime_dependencies when running 'otp_build patch_app'
Introduce system_information:sanity_check()
Merge branch 'rickard/runtime-dep/OTP-11773'

* rickard/runtime-dep/OTP-11773:
  Introduce system_information:sanity_check()
  Verify runtime_dependencies when running 'otp_build patch_app'
  Add test-case verifying runtime dependencies found by xref
  Introduce runtime_dependencies in .app files
  Bump versions and ensure that all are "normal" versions
Fix pick_peer case clause failure

In the case of {call_mutates_state, true} configuration on the service
in question, any peer selection that failed to select a peer resulted in
a case clause failure in diameter_service:pick_peer/5, when the call to
the service process returned false. This was noticed in the case of a
peer failover in which an alternate peer wasn't available.

The explicit matching is intentional, to match exactly what's expected.
Fix unicode path failure in diameter_make:codec/2

A dictionary path containing a unicode codepoint > 255 caused the
function to fail when iolist_to_binary/1 was applied to the path.
Adapt dictionary compilation to new default encoding

The problem is that the change in default encoding to utf8 in 17.0, in
commit 00e42967, changes the behaviour of erl_parse:abstract/1, which is
used by the dictionary compiler to turn terms into abstract code. In
particular, it transforms the orddict representation of a parsed
dictionary to contruct the return value of a dictionary module's dict/0
function. This orddict contains various lists, one of which is a list of
tuples of the form

  {Name, Code, [VendorId], [Avp]}

where Name is an ASCII string and VendorId is a non-negative integer.

Using erl_parse:abstract/2 instead allows a string encoding to be
specified but regardless of what encoding is used, the result of
transforming our tuple might not be what we really want, which is for
Name to always be represented as a string form and [VendorId] to always
be represented as a cons form: the [VendorId] will always end up as a
string form if the integers are small enough. The only way around this
is to transform the tuple bit by bit, but modifying the code to do this
is quite a lot of work, for not much gain: it would be nice to produce
more readable output but nothing stops working without it.

This commit restores the pre-17.0 conversion by explicilty specifying
latin1 as the string encoding to erl_parse:abstract/2. The utf8 encoding
broke the compilation of some dictionares since unicode strings aren't
expected when writing the generated code to file.

Note that the latin1 encoding does reasonably well in practice, although
it mangles the Ericsson Vendor Id list [193] into a "LATIN CAPITAL
LETTER A WITH ACUTE". The utf8 encoding does worse, mangling the 3GPP
Vendor Id 10415 into "DESERET CAPITAL LETTER CHEE". An ascii encoding
would do better than latin1 but doesn't yet exist. (Encoding isn't
really what the option is. It's a string predicate: if the predicate is
true then represent as a string form, otherwise a cons form.)
Protect generated .hrl files from multiple inclusions
Raspberry PI / Android a minimal cross-compile configuration

Enable a cross compile Erlang/OTP platform to Android or Raspberry PI
using Android NDK. Port emulator and core application to support target
HW platform. Exclude any add-on services required for OTP platform deployment
into target hardware due to device fragmentation and jail-break requirements.

 * fix erts/emulator/beam/sys.h
   Disable redefinition of __noreturn macro

 * port erts/emulator/sys/unix/erl_child_setup.c
   Use techniques proposed by https://code.google.com/p/erlang4android to
   access system properties

 * fix erts/emulator/sys/unix/erl_unix_sys_ddll.c
   The static linking of emulator cannot find dlerror(), dlopen() symbols

 * port erts/emulator/sys/unix/sys.c
   make path to shell configurable at build time

 * port erts/etc/common/Makefile.in
   disable librt for *-linux-androideabi

 * port erts/lib_src/pthread/ethread.c
   Use techniques proposed by https://code.google.com/p/erlang4android to
   disable emulator crash if kernel threads are on. Replace unreliable
   pthread_sigmask() by sigprocmask()

 * port lib/erl_interface/src/connect/ei_connect.c
   Disable call to undefined gethostid()

 * port lib/erl_interface/src/connect/ei_resolve.c
   Use gethostbyname_r() on Android platform
Introduce minimum allowed major driver and nif versions on load