Test whether x has a unit attribute containing an astropy unit.
This is useful, because different data types can still have units associated with them.