finish() should be implicitly called whenever you re-execute a statement (so you could wait to call it), but I think it's better practice to just put it right after the fetch. And what you may want to do instead of the separate execute/fetch/finish statements is a single selectrow statement:
($count) = $dbh->selectrow_array( $sth2, undef, $var );