Fix thread-safety when dealing with paging in ResultSet

JAVA-319 #fixes