WritableStream: Clear resolving functions

By making sure resolving functions are cleared on resolve/reject promises, we
can detect bugs.
I would factor this out into a method just for consistency.