Return an error_packet if a prepared statement is given an error.

If a prepared statement is given the error atom as an argument then
don't send it to the server, but shortcut and return an #error_packet{}
instead.

This makes it easier to debug the problem, and avoids sending garbage to
the server.