Massive Dirac fermions and spin physics in an ultrathin film of topological insulator