ensure done_handler is called once

when executed sequentially within the same nodejs process, it happens done_handler may be called twice.
Thus the second call fails because its connection get closed by the previous process.

This patch fix this issue, it also ensure done_handler is called in more possible failure case to avoid a pending process after a failure.