(Reuters) - Salesforce.com Inc posted a quarterly profit that narrowly beat analysts' estimates as it invested heavily to fend off competition in the cloud-based software sector.