fix a null pointer dereference

Thanks for writing this lib, it works well. I have actually merged it into the development version 1.13 of wesnoth. The only bug that I have noticed so far was this one, which can occur if you give it a null pointer for the RW_ops argument.