Rely-Guarantee Semantics for Separation-Logic-Based Specification Extraction