Fix new attributes API in debug mode

add attrDef to write-lock whitelist, test attributes in debug