Add priority search queue ADT

This implements a priority search queue ADT. This is a kind of blend
between priority queues and search trees; in contrast to a priority
queue, it also allows changing priorities of keys, looking up keys and
deleting keys.

This is an implementation based on the ICFP 2001 paper "A Simple
Implementation Technique for Priority Search Queues" by Ralf Hinze.
http://www.mercurylang.org/list-archives/users/2014-October/007804.html

Commit message paraphrased from Matthias' e-mail.
http://www.mercurylang.org/list-archives/reviews/2014-October/017414.html

library/psqueue.m:
    Add new module.

library/MODULES_DOC:
library/library.m:
    Include new module.

tests/hard_coded/Mmakefile:
tests/hard_coded/psqueue_test.exp:
tests/hard_coded/psqueue_test.m:
    Add test for psqueue.m
Update psqueue documentation.

library/psqueue.m:
    As atove.
Update psqueue.m code style.

library/psqueue.m:
    Update coding style.

    In min_view/1 there's two variable names are incorrect (they should be
    swapped) this doesn't change the program but may confuse people reading
    the code.

tests/hard_coded/psqueue_test.exp:
tests/hard_coded/psqueue_test.m:
    Also improve the coding style in the test code.
    Add lables to all of the test outputs.
Update psqueue.m's interface to match other library modules.

library/psqueue.m:
    Make the psqueue interface more consistent with other standard library
    modules.

tests/hard_coded/psqueue_test.exp:
tests/hard_coded/psqueue_test.m:
    Update tests.
Step 1 of moving trace_*_io_state out of private_builtin.m.

At the moment private_builtin.m imports the io module. This is undesirable,
since private_builtin should not depend on any other module. The import
is needed only for trace_{get,set}_io_state, predicates that are used
in the implementation of trace [io(!IO)] scopes to create and destroy
dummy I/O states.

The obvious thing to do to remove this undesirable dependency is to move
those predicates to another module, and the io module is the obvious choice.
Since these two predicate can also be used to implement Mercury's version
of Haskell's unsafe_perform_io, give the moved versions names that reflect
this, unsafe_{get,set}_io_state.

However, since private_builtin.trace_{get,set}_io_state are builtins,
moving them requires several steps.

The first step is making io.unsafe{get,set}_io_state builtins, with definitions
identical to private_builtin.trace_{get,set}_io_state.

The second step, once the first step has been installed on all developers'
machines, is to add declarations for io.unsafe{get,set}_io_state to io.m
(but not definitions, since these should not be there for builtins), and
to get the compiler to generate references to these instead of to
private_builtin.trace_{get,set}_io_state.

The third step, once the second step has been similarly installed, will be
to remove the declarations of private_builtin.trace_{get,set}_io_state,
and to remove the undesirable import.
Add an example of calling Mercury libraries from Java.

In particular, demonstrate how to invoke any module-local finalisers and
retrieve the exit status.

samples/java_interface/standalone_java/Makefile:
samples/java_interface/standalone_java/JavaMain.java:
samples/java_interface/standalone_java/mercury_lib.m:
	As above.

samples/java_interface/README:
	Describe the new directory.
Update NEWS file

NEWS:
    Add the creation of psqueue.m to the NEWS file.