Waiting for ajax to complete fixes spec from breaking in sqlite3. Fixes #3569