Fix string interpolation issue on wait_for_event

When the where clause has entity ids that would evaluate to invalid
Ruby strings, we get false positives on the comparison (due to some
strangeness around rescuing SyntaxError expressions)
Bump version to 0.0.39