Added windows support for SharedArray

Backport of #9044 merged to master in 9c9597d916291896a73d14c7b7d9ecf25e4d7aff.