ncgen: Fix java generation for nan values, use Float.NaN and Double.NaN

Java needs Float.NaN to include a nan value, simple fix like example in cdata.c