Fixing bug 1251 that affects some backports only

This defaults $self->{dbh} to the db handle in App_State.