#620 - Fix hibernate related job instances issue

The commit messages have all the details. Was causing issues with Run On All Agents and Run Multiple Instances. Fixed in a way close to the one mentioned by @srinivasupadhya and @jyotisingh [here](https://github.com/gocd/gocd/issues/620#issuecomment-57979205).