Populate the errorInfo field when exceptions are raised by PDOStatement objects

Fixes #2392.