Fix NPE in few places

This is redundant. `exc.getCause() instanceof HiveSQLException` is enough to check both null and non HiveSQLException objects.