Ensure that proxy close sets closed field

This avoids a cascading exception when the close method throws an
exception, e.g., when enforcing that someone called
Connection.prepareStatement.