MySQLi随机和临时致命错误

I have an environment where I use beanstalkd and pheanstalk to queue and process jobs asynchronously. One of my workers is passed a MySQL table name, and row id, along with other information. That worker then updates that row of that table.

This works fine 99% of the time. However, occasionally my worker crashes with:

PHP Fatal error:  Call to a member function bind_param() on a non-object in /path/to/file.php on line 62

As mentioned, this same line executes fine 99% of the time, but crashes every so often. The job it crashed on is not yet deleted and stays in the queue to be reprocessed by another worker. So when I restart the worker, it processes the same job it crashed on just moments earlier without issue.

My PHP looks something like this:

$stmt = $mysqli->prepare("UPDATE `database`.`$table` SET `Limit` = ? WHERE `D_ID` = ?");
$stmt->bind_param("si", $Limit, $rowID);
$stmt->execute();
$stmt->close();

The best I can figure is that because this is asynchronous, some other process happens to be locking that table/row at the time of execution. I would imagine the MySQL query to just wait for it's turn though and not out right crash.

Unfortunately, if this is the case, I have no way of testing or even fixing it, so I need a work around. If this is not the case, I need some guidance as to what the cause is and how to troubleshoot/fix it.

Update As suggested in the comments, I checked the mysql error code and error message. The result is:

(2006) MySQL server has gone away

From the sounds of it, the database connection has failed, however, when the worker deletes the job and grabs the next one, it works just fine using the same connection. What does this mean?