Fix problems preventing the system building in non-C grades.

compiler/mode_info.m:
	Avoid a warning due to he Mercury clause for the predicate
	old_and_new_may_differ/2 having too tight a determinism.

compiler/pickle.m:
	Fix cut-and-paste errors in Erlang foreign procs.

deep_profiler/DEEP_FLAGS.in:
	Specify the location of the Erlang library headers.
Fix Mantis bug #367.

library/array.m:
    When doing a binary search using a user-supplied comparison function,
    do not use the builtin term comparison operation to compare elements.

    Use separate loops for binary_search and approx_binary_search, since
    using the loop for approx_binary_search in the implementation of
    binary_search executes some unnecessary extra tests.

    Improve the documentation of both binary_search and approx_binary_search.

tests/general/array_binsearch.{m,exp}:
    Rewrite this test case to make it much tougher, testing the operation
    of binary_search and approx_binary_search with both the builtin and
    user-supplied comparison operations, and in the presence of repeated
    elements, and with automatic verification of the results.
Additions for the calendar module.

library/calendar.m:
    Add predicates and functions for converting between 1-based
    and 0-based month numbers and values of the month/0 type.
    The former are useful when dealing with human-provided dates
    whereas the latter are useful when interacting with dates
    provided from some foreign language (C and Java for example).

    Add a predicate for testing for equality of dates ignoring
    their time component.

    Replace the locally defined predicate char_to_digit/2 with
    calls to char.decimal_digit_to_int/2

    Fix some formatting issues.

tests/hard_coded/calendar_test.{m,exp}:
    Extend this test case to cover the functionality added
    above.

NEWS:
        Announce the additions.
Mark array.bsearch as obsolete.
Stand-alone interfaces and non-C grades.

Clarify the situation with stand-alone interfaces and non-C grades.  The
documentation currently says that they are not currently supported for the
non-C grades, which is inaccurate.  They are not actually required for the Java
and C# backends.  The may however be needed for Erlang.

doc/user_guide.texi:
	Stand-alone interface are *not* required if the target language is
	C# or Java.

compiler/mercury_compiler.m:
	Fix an XXX: generate a more accurate error message if
	'--generate-standalone-interface' is used with one of the
	non-C target languages.
Remove some unnecessary XXXs.
Fix an issue with potential code reordering.