[resourcepolicy-plugin] Implement missing resources released.

Emit resourcesReleased signal when receiving corresponding signal from
libresource-qt.

Fix for ef6554018a1605ee9bc7f8063fe52d05dacd71a5
[resourcepolicy-plugin] Implement availability changed.

Availability changed is information whether resources the client is
interested in are available (no higher priority resource classes have
acquired the resources).

Fix for ef6554018a1605ee9bc7f8063fe52d05dacd71a5
[qsoundeffect] Play samples only when resources are available.

Since sound effects are something short and mixed with other audio, do
not acquire resources explicitly. Follow the resources availability
information to determine when it is ok to play the sound effects.

When client has registered itself to resource manager, client's streams
are classified properly. If no higher priority client has acquired the
resources, isAvailable() is true, and sound effects can be played. We
do not explicitly acquire the resources, since then other clients with
the same resource class would lose the resources, thus not possible to
have second client play music with QMediaPlayer class while our client
would just want to play simple sound effects.
[qaudiooutput] Close output before destroying resource policy.
[resourcepolicy-plugin] Check for isDestroyed() in destructor.

Fix for ef6554018a1605ee9bc7f8063fe52d05dacd71a5
[qgstreamerplayercontrol] Add resource release timer when pausing or stopping media.

If media is paused, stopped, or end of media, if state hasn't changed to
playing state, release the resources. The idea with the timer is that if
for example media player is playing one song which ends, there won't be
release()/acquire() unnecessarily if next song is immediately set as
media and started playing.
[qaudiooutput] Improvements to resource handling.
[qaudiooutput] Add release timer for resources.
[resourcepolicy-plugin] Add mechanism to change used resource class.

Check for environment for special variable, and if the variable has
proper data, use that as the resource class. Can be set with for example
qputenv("NEMO_RESOURCE_CLASS_OVERRIDE", "game");

Fix for ef6554018a1605ee9bc7f8063fe52d05dacd71a5
[resourcepolicy-plugin] Release only once when no client acquires.

Fix for ef6554018a1605ee9bc7f8063fe52d05dacd71a5
[resourcepolicy-plugin] Emit resourcesReleased on release

Fix for ef6554018a1605ee9bc7f8063fe52d05dacd71a5
[resourcepolicy-plugin] Only release when last client releases

Fix for ef6554018a1605ee9bc7f8063fe52d05dacd71a5