Add queue_close() in the queue API.

This could be needed in case of queue based on database, that will need
a clean closed connection step.

queue_close() calls the callback registered by queue_api_on_close().
Merge branch 'master' into portable