$this->pdo = null removed when query fails

$this->pdo can't be null when query fails because pdo already holding
connection. If it sets to null then you need to initialize the
connection again.