Stop triggering warnings from inside the query

Remove calls to trigger_error() from inside the queries handlers and populate $query->_p2p_error instead.

Fixes #379