Ab initio study of confinement and surface effects in hexagonal AlN nanotubes