windows: fix console signal handler refcount

Backport of 0c726e7 from master