Change ids to be int64_t and fix type conversion warnings

Job ids can be bigger than a 32 bit int which is supported in this change.
Delay, Priority and TTR have been changed to unsigned ints.
I've also changed some places where a size_t was returned instead of an ssize_t swallowing errors.
I know this is a major API change but for us supporting job swith a higher id is a must.
Let me know if you think it's worthwhile to include this change in the client library!
Cheers,