Update writemask.py

Replaced pyfits with astropy