Crystallinity and superconductivity of as-grown MgB2 thin films with AlN buffer layers