Re #7857. Fix invalid initialisation of shared_array.

A boost::shared_array should be initialised with NULL or a pointer to an
array, so what was there were errors. In fact, in these cases there's no
need for any initialisation, only declaration.
Re #7857. Only initialise struct members if status is NX_OK.

If there is no next entry, NXgetnextentry will not have set the nxname
& nxclass variables that were passed to it. Therefore, a valgrind
complaint is avoided by checking for success & only coping the variables
on success.
Re #7857. Remove nonsense.

Nothing to do with this ticket, but this gave a ton of warnings when
built with clang and if you look at it it was clearly nonsense.
(N.B. nd is properly initialised later in the constructor.)
Merge remote-tracking branch 'origin/feature/7857_nexus_valgrind_errors'