plugin: Introduced basic support for per-plugin intervals.

This is based on a newly introduced "plugin context", which stores plugin-
related settings (currently the plugin interval) for each registered callback.
The context is initialized when loading the plugin (LoadPlugin), setting the
interval to the value of the newly introduced "Interval" option of the
LoadPlugin block, if specified.

The context is set (using thread-specific data) and restored before and after
calling any callback.

This way, single plugins don't need to take special care in order to benefit
from the new feature. plugin.c will handle (most) situations automatically.

VALUE_LIST_INIT() has been changed to honor the plugin interval settings (if
any). As a helper, the new 'plugin_interval' macro may be used to access the
current plugin's interval (read-only).

Thanks to Florian for the initial idea!
plugin: Added plugin_thread_create().

This function is a wrapper around pthread_create() which copies the plugin
context to the new thread. Else, that information would be lost.
src/plugin.c: Document the use of "register_complex_read".

Also add assertions to make sure plugin_init_ctx() is used correctly.
collectd.conf(5): Document the "LoadPlugin / Interval" option.
plugin: Added plugin_get_interval().

This function returns the current value of the plugin's interval. If no
interval has been set in the plugin context, it will fall back to the global
interval or ten seconds as a last resort.
Don't use 'interval_g' in any plugins.

Rather, use plugin_get_interval () in order to honor any plugin specific
interval settings.
Initialize plugin context to global interval before loading a plugin.

This ensures that the actual interval for each plugin is available through its
context. It is a preparation for removing 'interval_g' (which has limited use
after introducing per-plugin intervals and, thus, its use is rather error-
prone).
plugin: Don't switch plugin context in 'write', 'notification' and 'log'.

Rather, keep the context (i.e. interval) information of the calling (read)
plugin. This allows the write, notify and log callbacks to access the correct
interval settings appropriate for the current data-set.
Use plugin_thread_create() rather than pthread_create() in all plugins.

This function copies the plugin context from the calling thread to the new
thread. While this might not strictly be necessary in most/many cases, this
will make sure that any code within a plugin uses the same context
information, thus avoiding possible problems in the future.
src/plugin.c: Don't regularly check for read plugins.

Rather, let plugin_insert_read() wake up all the read threads.
This removes another usage of interval_g.
rrdtool plugin: Remove warnings.

They made sense when all data was collected at the same interval. This
has not been true for a while now and these warnings don't make any sense
anymore.

We could transform them into a per-VL check and use complaints to notify
the user, but I don't think it's worth it. There is an "I told you so"
in the manpage in big bold letters ...
src/plugin.c: Report an error if ctx.interval is not set.
perl plugin: Export plugin_get_interval() to Perl plugins.
Collectd::Plugins::OpenVZ: Use plugin_get_interval() rather than $interval_g.
Collectd.pm: Use plugin_get_interval() rather than $interval_g.
perl plugin: Simplified $interval_g implementation.

Don't pass any pointers to interval_g around just in order to later
dereference them. There's just no reason to do so ;-)
perl plugin: Emit a warning when accessing $interval_g.

Rather, point to plugin_get_interval().
collectd-perl(5): Mention that $interval_g should not be used.
collectd-perl(5): Don't actually use $interval_g in any examples.
src/configfile.[ch]: Implement the cf_get_default_interval() function.

This should be able to replace "interval_g" in a global (i.e. non-plugin)
context, such as the interval in which timeouts are being checked.

The default value (10 seconds) is also configurable at compile time using
a define.