Structural requirements of a membrane-spanning domain for protein anchoring and cell surface transport