Fixed race condition with two calls to port.once