Workaround NetBSD nan bug.

In NetBSD 5 and earlier, NAN is defined in such a way that it is not
usable as an initializer.  This commit adds a conditional to work
around this.

Probably it should not be applied to master, but I'm publishing it in
case it's helpful to others.