Fix #432: Set SW's state to installing before resolving a promise