report read error for syntactically invalid pastes
(unless as-text is checked)

- closes #19
- also eliminate some unneeded db queries