Fin Smith knocked over a last-minute penalty to edge his battle with Finn Russell as Northampton beat league leaders Bath 35-34 in a pulsating game of nine tries.