Fix busy? and ready_for_query?, and add a test for concurrent access.