Fix NODE_ENV check. When not set, it is undefined, not ''.

In development (when you don't pass `NODE_ENV=something` on the command line) it is `undefined`, but this module is checking for `''`, meaning that it does the graceful shutdown behaviour even in development.

In this PR I added a failing test which subsequently passed after making the code change.