Correctly detect null values when processing prepared statement result sets