Unsaved records queueing jobs

`after_commit` is fired even if the record is not saved, so activerecord is currently queueing a job when validation fails.

This commit fixes it for AR, but I don't know if the `new_record?` method exists in data mapper, so I cannot promise that it will not break DM support.