core: wbxmlencoder: remove possible endless loop
core: wbxmlencoder: remove possible endless loop

(if stream isn't a ressource for exemple)
use stream_copy_to_stream (more efficient)
check $bp with is_ressource()
fclose $bp

Signed-off-by: Etienne CHAMPETIER <d24370f93c848f9b9e9043ebb082d433901eaa60@fiducial.net>

fmbiete/Z-Push-contrib,Freeaqingme/Z-Push-contrib,RavenB/Z-Push-contrib,mta59066/Z-Push-contrib