Astronomer, a Baltimore-based tech firm, leveraged a viral scandal and Hollywood star power to transform a PR disaster into a marketing success.