Make retrieve functionality work for metadata APi versions 31.0+.

We need to use checkRetrieveStatus() instead of checkStatus() to check the status of a retrieve()
operation in progress.