Try to make JobManagerTest more predictable

Session status is changed like READY -> RUNNING -> FINISHED
after each status change, statusChange(job) callback is called.
and inside of statusChange callback, jobManager implement session persistence and history creation.
It means there will be a moment, after session become FINISHED status and session persisted and history created.
If test wait for status be FINISHED and looking for history then there's chance to history not exist for a certain time.

This pull request change statusChange() to beforeStatusChange() and afterStatusChange(). 
and all persistent, history creation is done inside of beforeStatusChange().
This change will make sure session persistence and making history done before status changed to FINISHED.