Added memory allocation error checks to windows library.