Improper variable sanitization
Fixes #2166 calling newreply with no tid does not show the correct error page
Fixes #2167 Calling polls.php with invalid pid shows sql error instead of correct error page