fix sqlalchemy's job.update() call to handle race condition

- the current query(job).update() method of sqlalchemy doesn't consider
  the version_id column introduced to handle race condition (Optimistic
Offline Lock).
- modified the update call to use session.add(job) & session.flush(job)
  so that sqlalchemy can use the optimistic offline lock feature using
job table's version id column.
- added test to ensure the version_id column is used as expected.
- fixed a minor pep8 issue on test_jobs
Merge pull request #296 from venkateshsampath/rm1348_sqlalchemy_fix

fix sqlalchemy's job.update() call to handle race condition