Correctly handles `attrs['readonly'] = True`

Thanks to https://gist.github.com/czpython/7683425 for posting the fix.

Signed-off-by: JP-Ellis <coujellis@gmail.com>