Added writeAsync version of write which "returns" an event that can be waited on