Trace identities and almost polynomial growth