LIB-45: also try /dev/cdrom1 on Linux

Current Debian and Ubuntu releases don't seem to create /dev/cdrom
anymore, but only /dev/cdrom1, /dev/cdrom2 etc.

This should fix most cases when the actual device doesn't change.
When devices really change we could start analyzing
/proc/sys/dev/cdrom/info.
LIB-45: add another default device possibility

This device name was found on a SunOS 5.10 = Solaris 10.
create and use mb_disc_unix_find_devices()

instead of duplicating code
LIB-45: check both device names on FreeBSD
LIB-45: try both device names on NetBSD/OpenBSD

Additionally re-add the information to the FreeBSD device names.
fix typo on Linux drive candidates
LIB-45: parse /proc/sys/dev/cdrom on Linux

This extracts the default drive from /proc and falls back to
one of the hard coded defaults if this isn't available,
for the error message.

We might rather want to prefer /dev/cdrom, but that needs
fiddling with find_drive/exists in unix.c again.
LIB-45: prefer /dev/cdrom on Linux if available
Use strtok_r for thread-safety

Signed-off-by: Sebastian Ramacher <sramacher@debian.org>
Use first available CD drive on Windows as default.
Make default_device thread-local

Signed-off-by: Sebastian Ramacher <sramacher@debian.org>
Name the define THREAD_LOCAL and define it in every case

Signed-off-by: Sebastian Ramacher <sramacher@debian.org>
Add discid_get_toc_string() to get 'toc=...' string alone.

Use it in create_submission_url() and create_webservice_url(), reducing
code redundancy.
Calculations of buffers length was slightly modified to be safe.
Adjust buffer sizes
Allocate memory in create_toc_string() and allow to pass a string separator.
create_toc_string(): do not allocate more than needed.

Size calculation is commented.
Add discid_get_toc_string()
Fix comments
LIB-52: verify sectors given to put()

The first element in the array is the overall disc length, which must
be bigger than everything else.
All offsets have to be smaller than a maximum.
LIB-52: verify offset order and test verification

Some common errors should definately be catched.
We can't catch one important thing: The length of the array.
This hopefully triggers one of the other problems, too.