Fix multi-threading bug not firing success callbacks (#778)
Fix multi-threading bug not firing success callbacks (#778)

`@valid_transitions` is shared across threads, when a thread consumes a
transition, another thread which should execute the same transition for
another model instance may ignore its success callback.

This change avoid to share the same hash of transition across different
model instances. Each instance will have its own hash of transitions.
The hash itself is not subject to thread race conditions as the object ids
are unique. Also, the transitions for an object_id are cleaned after the
transition have been fired, otherwise the hash would grow infinitely.

See https://github.com/aasm/aasm/issues/448#issuecomment-377922368 for
an example of code to reproduce the multi-thread bug.

Fixes #448
aasm/aasm