Improvements to SQL queries in postratings-manager.php

* Replace some SQL queries with WP API functions where easily possible;
avoids problems with values not being cleared from a post's object
cache.
* Use $wpdb->prepare to make queries safer, where easily possible.
* Add missing sanitisation to $_POST['delete_postid'].
* Add missing sanitisation when building  $postratings_where.
* Add some @todos for future improvements.
Add missing changes from last commit

Sorry!
Remove duplication= when setting the <form> action= property

We already set these at the top of the file
Remove unnecessary switch() block for $_POST['do']
Decrease the line indentation in the form handler