Check the error status of prepareStatement in execute batch

Currently it seems some code got inserted in between the error check for prepare statement. This code access the info return value, which might be nil, which can cause a panic.

This PR simply moves up the error check.